Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #mlog
- #Csandriel
- #~2015
- DELIM="---------------------------------------------"
- FILE="/home/user/mylog"
- APPEND=false
- if [ "$1" == "-a" ]
- then
- APPEND=true
- echo Ready to APPEND to the last entry
- elif [ "$1" == "-l" ]; then
- cat "$FILE"
- exit 0
- elif [ "$1" ]; then
- echo key invalid
- exit 1
- else
- echo Ready to recieve a NEW log entry:
- fi
- read
- if ! $APPEND
- then
- echo -e "\n$DELIM\n">>$FILE
- echo -e "\t`date`\n">>$FILE
- fi
- echo $REPLY>>$FILE
- exit 0
Add Comment
Please, Sign In to add comment