February, 2012

Scripting Tips #2: How to compare 2 sets of files to see if they are the same?

Excerpts from Simplify, Automate, Liberate! For Unix/Linux System Administrators written by Gerald Yong Problem You have 2 different folders, and you want to compare the files in the folders to see if they are the same or different. The files have the same names in both folders. Solution Compute a fast hash or checksum for all the files would be a faster method. ...

Read More

Scripting Tips #1: How to check if a command has run successfully

Excerpts from Simplify, Automate, Liberate! For Unix/Linux System Administrators written by Gerald Yong Problem You have a script, and inside the script you call an external command. You want to know if the command has succeeded or failed, and take appropriate action. For example, you may want to know if the scp command that copies a local file to a remote destination was...

Read More