bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set -e (no || or &&)


From: Dan Douglas
Subject: Re: set -e (no || or &&)
Date: Mon, 15 Oct 2012 07:53:37 -0500
User-agent: KMail/4.8.3 (Linux/3.4.6-pf+; KDE/4.8.3; x86_64; ; )

On Sunday, October 14, 2012 05:21:05 PM Linda Walsh wrote:
> Seriously -- why not just fix it?
> 
> If you think it is broken -- Fix it.

This should fix most scripts.

case $- in
    *e*) exec /bin/sh -c 'cat; rm -f "$1"; exit 1' -- "$BASH_SOURCE" <<-"EOF" 
>&2
    Error: Braindamage detected. Protecting your system.
EOF
esac
-- 
Dan Douglas

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]