Monthly Archives: July 2007

target of a symlink

It took me ages to find this, so I will record it. To find the target of a symbolic link, you can use the ‘readlink’ command. Or in my case, you can find the real file or directory of the current script like this: #!/bin/bash MY_FILE=`readlink -f $0` MY_DIR=`dirname $MY_FILE` … The ‘-f’ option means […]

useful sed scripts

A common problem – replace DOS line endings with Unix ones, across a bunch of files. (I had a dump from my old Windows work machine, which was not cooperating with CVS when I just copied it onto this machine). To type the ‘^M’ in Bash, type ctrl-V, then ctrl-M. find . -type f -exec […]

another place

Those who have been following along may be interested to know that I am now a resident of the United States of America! (Actually I’ve been here three weeks now, but I’ve been pretty busy sorting out things). I’m in the greater Boston area – if anyone wants to point out geek events here I […]