added read and edit feature to journal.sh
This commit is contained in:
parent
f4dcb02fe5
commit
da9910784a
13
journal.sh
13
journal.sh
|
@ -4,7 +4,6 @@
|
|||
# track of what i do and think
|
||||
|
||||
|
||||
|
||||
#check if output file is given as first option
|
||||
if [ -z $1 ]; then
|
||||
outputfile=journal.txt
|
||||
|
@ -12,6 +11,18 @@ else
|
|||
outputfile=$1
|
||||
fi
|
||||
|
||||
if [ -z $2 ]; then
|
||||
:
|
||||
else
|
||||
if [ $2 = "read" ]; then
|
||||
less $outputfile
|
||||
exit $?
|
||||
elif [ $2 = "edit" ]; then
|
||||
vim $outputfile
|
||||
exit $?
|
||||
fi
|
||||
fi
|
||||
|
||||
#generating timestamp
|
||||
timestamp=$(date '+%d.%m.%Y %H:%M')
|
||||
|
||||
|
|
Loading…
Reference in New Issue