HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Trap signal
Operating System - HP-UX
1825776
Members
2013
Online
109687
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-20-2004 09:14 PM
07-20-2004 09:14 PM
Trap signal
Hi,
For /etc/profile, there is a line called trap. To enable, put as trap 1 2 3. To disable, put as trap "" 1 2 3.
Questions:
1) How about trap : 1 2 3?
2) What I know is signal 1 for hang up, 2 for interrupt and 3 for quit. How to know which keys refer to which signal? I know ctrl+bckspace is signal 2 and ctrl+\ is signal 3.
3) Any reference about trap signal?
regards.
For /etc/profile, there is a line called trap. To enable, put as trap 1 2 3. To disable, put as trap "" 1 2 3.
Questions:
1) How about trap : 1 2 3?
2) What I know is signal 1 for hang up, 2 for interrupt and 3 for quit. How to know which keys refer to which signal? I know ctrl+bckspace is signal 2 and ctrl+\ is signal 3.
3) Any reference about trap signal?
regards.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2004 09:21 PM
07-20-2004 09:21 PM
Re: Trap signal
Hi,
kill -l will give you the different signals
HTH
Franky
kill -l will give you the different signals
HTH
Franky
Don't worry be happy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2004 09:30 PM
07-20-2004 09:30 PM
Re: Trap signal
Hi,
What is the signal for Delete button?
regards.
What is the signal for Delete button?
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2004 10:34 PM
07-20-2004 10:34 PM
Re: Trap signal
If we use trap "" 1 2 3 means, after trapping the SIGHUP, SIGINT, SIGQUIT signals, it wouldn't do nothing. you can test it a shell as,
#!/usr/bin/ksh
test1()
{
echo "Got signal "
echo "bye to shell"
}
trap "test1" 1 2 3
exit 0
Check with kill -1 pid of shell program or -2 or with -3
We can not use : with the trap
trap is used as ,
trap [arg] [sig ...]
If arg is the null string, this signal is ignored by the shell and by the commands it invokes.
To get the default action of trap in shell as,
#trap
trap -- 'echo '\''logout root'\' EXIT
If you give EXIT signal it will show the message.
References:
We can know the trap using man ksh page, man stty man pages.
We can know the signal controls with stty (terminal I/O options) as,
# stty -a or #stty
Use the csh shell to use delete as like linux.
Regards,
Muthukumar.
#!/usr/bin/ksh
test1()
{
echo "Got signal "
echo "bye to shell"
}
trap "test1" 1 2 3
exit 0
Check with kill -1 pid of shell program or -2 or with -3
We can not use : with the trap
trap is used as ,
trap [arg] [sig ...]
If arg is the null string, this signal is ignored by the shell and by the commands it invokes.
To get the default action of trap in shell as,
#trap
trap -- 'echo '\''logout root'\' EXIT
If you give EXIT signal it will show the message.
References:
We can know the trap using man ksh page, man stty man pages.
We can know the signal controls with stty (terminal I/O options) as,
# stty -a or #stty
Use the csh shell to use delete as like linux.
Regards,
Muthukumar.
Easy to suggest when don't know about the problem!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP