- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- unix command trap
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2006 07:57 PM
тАО07-18-2006 07:57 PM
unix command trap
"trap ... ; ; trap - 0 1 2 3 15 ; exit 2" 0 1 2 3 15"
what does "trap -" do ?
example of a SHELL Script
test_prozedure()
{
PRID=$$
trap "rm -f /tmp/sh${PRID}.? ; trap - 0 1 2 3 15 ; exit 2" 0 1 2 3 15
sqlplus -s <<-EOF
.
whenever sqlerror exit 9;
whenever oserror exit 9;
.
Commands ....
.
exit 0
EOF
return ${return_cd:-0}
}
test_prozedure
echo $?
best regards Tom
- Tags:
- trap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2006 08:16 PM
тАО07-18-2006 08:16 PM
Re: unix command trap
Trap syntax is
trap [arg] [sig]
Where [arg] - command to execute when shell receives listed signals [sig].
YOu can interprest this for your cases.
Regards,
Rajesh SB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2006 10:13 PM
тАО07-18-2006 10:13 PM
Re: unix command trap
From the 'sh-posix(1)' manpages:
trap [arg] [sig]...
If arg is - (or if arg is omitted and the first sig is numeric), reset all traps for each sig to their original values.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2006 04:24 AM
тАО07-19-2006 04:24 AM
Re: unix command trap
Thx for your useful answers !
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-19-2006 04:26 AM
тАО07-19-2006 04:26 AM