Tips and Tricks

Back

Text Substitition

You can use sed to perform text substitution in files. Suppose you want to change the string "old" to "new" in all the header files in a directory. You can accomplish this with the following command in a bash shell.

for x in $(ls *.h); do sed 's/old/new/g' $x >t; mv t $x; done

SSH on Mac OS X

Use the following command to add your passphrase to your keychain.

ssh-add -K

http://www.its.caltech.edu/~sean/ / at(sean, dot(caltech, edu)) / Last Modified: September 3, 2009