March 12, 2008...9:13 pm

Shell games

Jump to Comments

Rob Sanheim’s productivity talk got me thinking about a shortcut that I’ve been meaning to create but never seem to get around to.

For quite a while I’ve had a line like this in my login script:

alias svnupall=”svn up /code/project1; svn up /code/project2; svn up /code/project3″

Normally it’s not that much of a pain to open that puppy back up and edit when I add/remove yet another project or branch that it should manage, but the cumulative effect finally got to me so I wrote a little shell script to just do it automagically:

all_np=”"
cd /SourceControl/nextpoint_source

for i in *
do
alias “cd${i}”=”cd /SourceControl/nextpoint_source/${i}”
all_np=”${all_np}svn up /SourceControl/nextpoint_source/${i};”
done

alias svnupnp=”${all_np}”

I decided the easiest way to come up with “which of these directories is actually a work project” was to add the “nextpoint_source” level… which made “cd /SourceControl/nextpoint_source/foo” annoying, so I dropped in that “cdfoo” alias. Of course, there are a hundred other little things that could be added there but we’ll see if I actually end up wanting them.

I’m sure there’s a better and more succinct way (what is it?) but this is already going to be much nicer.

Update: I forgot to mention that I don’t cd back out after what you see above, so I start out in my nextpoint_source dir (where I want to start 95% of the time).

Leave a Reply