Shell Script for backpack todo lists
I whipped up this shell script for adding items to your backpack todo list. I've tested this on Mac OSX 10.4 (Tiger) but it should work on any mac, and most unix operating systems if your using a bash shell.
Ok, to start create a
bin directory inside your home directory, if you do not already have one, and make it executable.
mkdir ~/bin chmod u+x ~/bin
Next create a file called
todo, and use the following for the contents:
#!/bin/bash ADDY="[email protected]" SUB="Subject: todo: $1" echo $SUB | sendmail -f [email protected] $ADDY
Put the page email address in side the quotes in the
ADDY variable. Replace
[email protected] with your email address.
Now make sure your todo script is executable:
chmod u+x todo
And test it:
Note that if you want to use spaces, or multiple words you need to put the todo item in quotes:
~/bin/todo "things to do"
Now you probably don't want to type the
~/bin/ part every time, so lets add
~/bin to your path. Start by editing a file called
sudo vi /etc/profile
PATH variable to include
Note this will add the bin directory to the system path for every user on the computer.
The line may look something like this when your done:
Side note: A better way to do this is by editing the
~/.bashrcfiles, but they don't appear to be enabled by default on Mac OS X.
Now you can just type
todo "something to do" from anywhere inside your shell.
Like this? Follow me ↯Tweet Follow @pfreitag
Shell Script for backpack todo lists was first published on August 20, 2005.
If you like reading about terminal, shell, backpack, todo, bash, mac, osx, or 37signals then you might also like:
- The 15 Essential UNIX commands
- Bash Script to log file modifications with osquery
- Creating a Symbolic Link with ln -s What Comes First?
- Bash Loop To Wait for Server to Start
- Recursively Counting files by Extension on Mac or Linux
- Mac Terminal Open Finder in Current Directory
- Working with /etc/hosts on Mac
- Anyone used MacFuse?
Want Security Advisories via Email?
Advisory Week is a new weekly email containing security advisories published by major software vendors (Adobe, Apple, Microsoft, etc).