I'm writing this script to work as a fast draft. It opens my text editor with date and time, so I can insert some draft text to save quickly.
1. At first I'd like to append the date and time at the beginning of the file instead of at the end, as
>> $file does. But I guess that it is not so easy, so this is not my priority.
2. I defined an argument
$1. If I have only few words to insert I believe that it is better to run
draft "foo foo" instead of opening the editor to write just few words.
Well, it is working but with the argument the last line is not necessary. So I'd like to make it a conditional line. If I pass no argument, then open editor; else none.
Any help to improve my script?
#!/bin/bash file=rascunho folder=/home/$USER/ #linha=$(wc -l < $file) content=$1 #rm $folder$file printf "\n\n" >> $file #echo " " >> $file echo "------< $(date "+%b %d, %Y - %H:%M:%S") >------" >> $file echo "$1" >> $file exec leafpad $file