line feeds

Richard Lightman richard at nezumi.plus.com
Tue Mar 19 23:56:38 PST 2002


* andrew sprott <andru at btinternet.com> [2002-03-20 06:52]:
> hi ppl
> 
> i've got a weird one here. i recon that the blank lines in the text files were
> affectin the operation of my installation scripts. i think a blank line reset
> the exit status of the command in the previous line. so if a error happens
> the script won't exit.
> 
One importantant quality of a programmer is lazyness. Instead of testing
$? after every command, start you script with:

#! /bin/bash -e

This will cause the script to exit after any error except in places like:

while false; do
  true
done

if false; then
  true
fi


Richard

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list