Simple bash problem.

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

 



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
-------------------------------------------------------------------

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux