Unix/Linux shell script reference page

Linux shell script test syntax

All of the shell script tests that follow should be performed between the bracket characters [ and ], like this:

if [ true ]
  # do something here

Very important: Make sure you leave spaces around the bracket characters.

I'll show more detailed tests as we go along.

To perform tests on files use the following comparison operators:

A Perl script to convert Nagios/Unix epoch time to a human readable format

I had to work with Nagios a lot this morning, in particular reading through the nagios.log log file. If you're ever read that log file, or looked at some other Linux/Unix log files, you've seen records that display the time in an epoch time format, which looks like this:


If you can read the epoch time format and know the actual human readable date and time, you're a better person than I am (or you've been looking at Nagios, Linux, or Unix log files too long).

Debug Ant build problems with echo statements

Ant FAQ: How to use echo commands to debug Ant build scripts.

I've been moving back and forth between a ton of different computers lately -- Mac, Linux, and Windows computers -- and I had some problems with an Ant build script. This particular Ant script is complex, and I kept making mistakes, and needed a good way to debug the build process as I set up my application on these different systems.

Syndicate content