Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # For making little notes for posterity
- # Copyright (c) 2012 2ck
- cd ~/ideas
- timestamp=`date --rfc-3339=seconds`
- nideas=`ls -1 | wc -l`
- if [ -z "$1" ] ; then
- echo "I need a title, kid."
- exit 1
- fi
- fname=`echo $nideas-$1 | sed -e "s/ /_/"`
- echo "$1" | tr '[a-z]' '[A-Z]' | cat >dt
- echo "$1 " | sed s/./-/g | cat >>dt
- echo >>dt
- echo >>dt
- echo --$USER >>dt
- echo $timestamp >>dt
- vim -c "read dt" -c "set wrap" -c 'startinsert' +/^$/ "$fname"
- rm dt
- if [ -e .$fname.sw* ] ; then
- rm -v .$fname.sw*
- fi
Advertisement
Add Comment
Please, Sign In to add comment