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="pageFunkyName@username.backpackit.com" SUB="Subject: todo: $1" echo $SUB | sendmail -f your@email.com $ADDY
Put the page email address in side the quotes in the ADDY variable. Replace your@email.com with your email address.
Now make sure your todo script is executable:
chmod u+x todo
And test it:
~/bin/todo things
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 /etc/profile
sudo vi /etc/profile
Edit the PATH variable to include ~/bin.
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:
PATH="/bin:/sbin:/usr/bin:/usr/sbin:~/bin"
Side note: A better way to do this is by editing the ~/.bashrc files, 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.
add to del.icio.us
| Tags: terminal, shell, backpack, todo, bash, mac, osx, 37signals
Related Entries
- The 15 Essential UNIX commands - July 29, 2005
- Working with /etc/hosts on Mac - December 1, 2008
- Anyone used MacFuse? - January 13, 2007
- Howto Backup your Mac incrementally over SSH - March 10, 2006
- USB Phone for Skype on Mac - March 3, 2006
Trackbacks
Trackback Address: 449/90AF62D5B5E9B107317A819649C429C8
Comments
On 08/20/2005 at 5:42:12 PM EDT steve wrote:
1
cool! and you can automate it even more by adding it to your crontab
On 08/20/2005 at 6:01:01 PM EDT Pete Freitag wrote:
2
not sure why you would want to do that?
On 08/20/2005 at 9:40:27 PM EDT jehiah wrote:
3
I think you can also put the path in ~/.profile if you don't want it to be system wide.
On 08/21/2005 at 8:02:39 PM EDT Pete Freitag wrote:
4
After some thought, I agree it would by handy to use this with a cron job. You could setup cron jobs for things like take out the trash, pay the bills, etc.
Jehiah, thanks on the ~/.profile I'll give that a try.
On 08/25/2005 at 9:37:17 AM EDT forgetfoo wrote:
5
[off topic]
was just searching around, and thought i'd drop a quick line and ask... you wouldnt happen to have some CF code for reading/parse'n an ATOM feed, would you?
for some reason when i output the "content" tag, it returns nothing (blank, nada, null), and i'm not quite sure why... *scratches head*
really appreciate any help or links :)
On 08/27/2005 at 10:52:05 AM EDT Pete Freitag wrote:
6
foo - search for: atom cfc two cfc's should come up, one by Roger B, and one by Raymond C.
On 08/27/2005 at 11:26:51 AM EDT forgetfoo wrote:
7
thanks pete!
/fires up google
Post a Comment
Recent Entries
- Cache Template in Request Setting Explained
- What Version of Java is ColdFusion Using?
- ColdFusion 9 Performance Brief from Adobe
- Request Filtering in IIS 7 Howto
- J2EE Session Cookies on ColdFusion / JRun
- Hands on ColdFusion Security Training
- ColdFusion 9 Solr Vulnerability - Are you at Risk?
- FCKEditor Year 2010 Bug for Firefox 3.6 with ColdFusion
Jehiah, thanks on the ~/.profile I'll give that a try.
was just searching around, and thought i'd drop a quick line and ask... you wouldnt happen to have some CF code for reading/parse'n an ATOM feed, would you?
for some reason when i output the "content" tag, it returns nothing (blank, nada, null), and i'm not quite sure why... *scratches head*
really appreciate any help or links :)
/fires up google







