Tips & Tricks Tuesday: Baking some task batches with a shell script
When you have a set of tasks you do frequently, it can be handy to have them ready to go each time. This week’s tip, shared by fabianhemmert, demonstrates this for business trips with a handy shell script that even generates the due dates.
I often go on business trips, for which I find myself always add the same tasks: Book the flight and hotel (timed three weeks in advance), pack (timed on the day before) and file an expense report (timed on the day after the event).
I wrote a little shell script (based on rumember) that automates this. It calculates the relative dates and makes a list of tasks, in relative timing to the “main” thing. It can surely be adjusted to suit your needs in terms of timed tasks that often occur together:--- trip --#!/bin/bashif [ -z "$2" ]thenecho ""echo "Syntax: trip TITLE 31.05.2015"elseday=`date -jf '%d.%m.%Y' $2 '+%d.%m.%Y'`day_after=`date -v+1d -ujf"%d.%m.%Y" $day +%d.%m.%Y`;day_before=`date -v-1d -ujf"%d.%m.%Y" $day +%d.%m.%Y`;threeweeks_before=`date -v-21d -ujf"%d.%m.%Y" $day +%d.%m.%Y`;#cat > todo.txt << EOLru Book Flight $1 $threeweeks_before '#Timed'ru Book Hotel $1 $threeweeks_before '#Timed'ru Pack for $1 $day_before '#Timed'ru Expense Report $1 $day_after '#Timed'#EOL#cat todo.txt#mail -s "" xxxxxxxxxxxxxx+import@rmilk.com < todo.txtfi---------
Thanks for sharing this tip, fabianhemmert! You’re our Tips & Tricks Tuesday winner this week.
Do you have a suggestion for our weekly Tips & Tricks post? Got an interesting set-up or idea? Head over to the Tips & Tricks forum, add a new topic, and let us know how you use Remember The Milk. Each week we’ll give away a 1 year Pro account to the user whose idea inspires the Tips & Tricks Tuesday blog post for that week.