Skip to content

Category Archives: Linux/Unix

Redirect stdout to log from a bash script

My colleague Day Barr found this very useful Stack Overflow article. It shows how to redirect stdout to a log file from with a bash script. This is very useful if you’re debugging an existing bash script and don’t want to add a redirect to every line in it.

Useful Linux commands

Thus is just a list of useful Linux commands. Putting them here means I can always find them. See the info of an uninstalled rpm : rpm -qip –provides an.rpm Check Linux is 64 bit: egrep -c ‘ lm ‘ /proc/cpuinfo Bigger than zero means 64 bit. Lm stands for Long Mode. Check that a […]

GNU chess and xboard on eee PC

The eee PC is a cool little machine. It boots up in 20 seconds, weights about a kilo and it runs Linux. What else do you want in a netbook ? A chess program would be a nice addition. Here I’ll show you how to install GNU chess and xboard. First download the following packages […]

Korn shell way of checking if environment variable is set

Sometimes you have to check if a variable is set and exit if it’s not. The following code does it in a nice and simple way : error_mess=”This environment variable should be set” : ${ORACLE_HOME:?$error_mess} The output looks like this : ./[3]: ORACLE_HOME: This environment variable should be set The script exits after checking ORACLE_HOME, […]