Tuesday, 12 May 2009

Bash Script Debugging

A seemingly very simple technique which is a lifesaver in checking bash scripts: instead of running the script, e.g.

./renamefiles.sh

run

bash -x ./renamefiles.sh

for a command by command report of activity in the script. Each command is preceded by a "+". Lines without a "+" are ordinary script outputs.

0 comments:

iantheteacher

Planet ILUG