Skip to content

Instantly share code, notes, and snippets.

@lumin3000
Created January 28, 2012 07:55
Show Gist options
  • Save lumin3000/1693316 to your computer and use it in GitHub Desktop.
Save lumin3000/1693316 to your computer and use it in GitHub Desktop.
DOINGFILE="..../nvalt/whatiamdoing.md"
if [[ $# -eq 0 ]]; then
awk '{\
if (currently==1)
if (match($0,/^[^\t]/))
currently=0
else {
if ($0 !~ /@done/) {
sub(/^[ \t]+/,"")
print
}
}
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
@lumin3000
Copy link
Author

I: new topic “ whatiamdoing” in NValt

II:whatiamdoing.md file should have this begining:
@(whatiwasdoing)
Currently:

@lumin3000
Copy link
Author

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