Simple bash problem.

Simon Ashford Simon.Ashford at npl.co.uk
Sun Jan 28 23:56:37 UTC 2007


Anyone know why the following simple bash script fails
on RHEL3 (fully patched)?  It seems the "trap" command
is being silently ignored.


--------------------------------------------
#!/bin/sh

sigtrap () {
    echo "Caught signal!"
    exit 0
}

trap sigtrap 1 2 3 15

while read X; do
    echo $X
done
--------------------------------------------


Simon Ashford.

-------------------------------------------------------------------
This e-mail and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only.
If you are not a named addressee, you must not use, retain or
disclose such information.

NPL Management Ltd cannot guarantee that the e-mail or any
attachments are free from viruses.

NPL Management Ltd. Registered in England and Wales. No: 2937881
Registered Office: Serco House, 16 Bartley Wood Business Park,
                   Hook, Hampshire, United Kingdom  RG27 9UY
-------------------------------------------------------------------




More information about the redhat-list mailing list