Tech and travel

Category: Linux/Unix

Redirect stdout to log from a bash script

2013-07-09

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

2013-05-12

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 package is installed in Ubuntu : `dpkg --get-selections | grep python`

GNU chess and xboard on eee PC

2008-10-06

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 : the debian etch gnuchess package the debian etch xaw3dg package the debian etch xboard package You’ll need to download the i386 architecture package.

Korn shell way of checking if environment variable is set

2007-07-04

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 : ./script.sh[3]: ORACLE_HOME: This environment variable should be set The script exits after checking ORACLE_HOME, none of the following commands get executed. I found this in the sample chapter of the The Korn Shell: Unix & Linux Programming Manual, 3rd Edition book.

Automating FTP

2007-07-02

Here’s how you automate FTP : ftp -v -n hostname << EOF user usuario password bin put filename bye EOF With thanks to this post.

Copyright (c) 2024 Michel Hollands