Hi,

On Samstag, 12. Februar 2011, Thomas Lange wrote:
> Author: lange
> Date: 2011-02-12 17:53:27 +0000 (Sat, 12 Feb 2011)
> New Revision: 6291
>
> Modified:
>    trunk/examples/simple/files/boot/grub/menu.lst/postinst
>    trunk/examples/simple/scripts/CENTOS/10-security
>    trunk/examples/simple/scripts/CENTOS/30-mkinitrd
>    trunk/examples/simple/scripts/CENTOS/40-install-grub
>    trunk/examples/simple/scripts/DEBIAN/10-keymap
>    trunk/examples/simple/scripts/DEBIAN/10-rootpw
>    trunk/examples/simple/scripts/DEBIAN/30-interface
>    trunk/examples/simple/scripts/DEBIAN/40-misc
>    trunk/examples/simple/scripts/FAIBASE/10-misc
>    trunk/examples/simple/scripts/GRUB/10-setup
>    trunk/examples/simple/scripts/GRUB/20-initramfs
>    trunk/examples/simple/scripts/GRUB_PC/10-setup
>    trunk/examples/simple/scripts/LAST/50-misc
> Log:
> new code for trap ERR, it now saves the maximum value of all errors
>
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error
> -error=0 ; trap "error=$((error|1))" ERR
> +error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error

this screams "use a shell function and include it everywhere" to me.


cheers,
        Holger

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

Antwort per Email an