On 03/07/10 00:17, Baho Utot wrote:
> Neal Murphy wrote:
 >>
>> Cleverly crafted, you should be able to catch most of the errors when they
>> happen while maintaining a readable script.
>
> If using bash a simple:
>
> #!/bin/bash -e
> set +h
>
> at the top of the script works, bails on any error

One nitpick there, that works if you run the script with:
./script-name
but if you run it with bash (or any other shell) like so:
bash script-name
bash will ignore the shebang as a comment, so the -e is not interpreted. 
Using set works every time.

#!/bin/bash
set -e

Andy
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to