Adam Young: A minor addition for todo.txt

I had a simple todo list I managed using shell scripts and git, but I wanted something for the Cell phone. The todo.txt application fills that need now. But I was able to reuse something from my old approach to make it a little more command line friendly.

I want to be able to add a todo from the command line without thinking syntax or dates or anything. Here is the code:

 

#!/bin/sh

TODOLINE=`date +%Y-%m-%d`
until [ -z "$1" ] # Until all parameters used up . . .
do
 TODOLINE=$TODOLINE" $1 "
 shift
done

pushd $HOME/Dropbox/todo

echo $TODOLINE >> todo.txt

I have it in  ~/bin/add_todo~/bin is a part of $PATH.    To remember something, I type:

add_todo Meet with Jim on Monday

And In the corresponding document I get:

2017-09-23 Meet with Jim on Monday

The thing I like about the script is that it treats each command line argument as part of the message;  no quotes are required.


Source From: fedoraplanet.org.
Original article title: Adam Young: A minor addition for todo.txt.
This full article can be read at: Adam Young: A minor addition for todo.txt.

Advertisement


Random Article You May Like

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*