Created
January 28, 2012 07:55
-
-
Save lumin3000/1693316 to your computer and use it in GitHub Desktop.
doing script for nvalt todo: http://brettterpstra.com/scatterbrains-2-the-geekening/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOINGFILE="..../nvalt/whatiamdoing.md" | |
if [[ $# -eq 0 ]]; then | |
awk '{\ | |
if (currently==1) | |
if (match($0,/^[^\t]/)) | |
currently=0 | |
else { | |
if ($0 !~ /@done/) { | |
sub(/^[ \t]+/,"") | |
} | |
} | |
else | |
if (match($0,"Currently:")) | |
currently=1 | |
}' "$DOINGFILE" | |
else | |
input="$@" | |
head=`awk 'NR < 3' "$DOINGFILE"` | |
tail=`awk 'NR > 2' "$DOINGFILE"` | |
datestamp=`date +'%Y-%m-%d %H:%M'` | |
echo "$head\n\t- $datestamp | $input\n$tail" > "$DOINGFILE" | |
fi |
sudo chmod a+x path/to/doing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I: new topic “ whatiamdoing” in NValt
II:whatiamdoing.md file should have this begining:
@(whatiwasdoing)
Currently: