Sponsored Content
Top Forums Shell Programming and Scripting hi all please help me in this issue. Post 302341146 by bhas85 on Wednesday 5th of August 2009 06:53:52 AM
Old 08-05-2009
hi Kshji

Kshji,

I am very sorry for my misunderstanding of the code.Its because of my poor knowledge.Now I got the one from your precious code.But what I thought is. If i have a program and it is running.Different signals comes into picture.So i want to trap the signals form that program and some functioning for that particular signal.
The signals are,
case SIGHUP
case SIGINT
case SIGQUIT
case SIGILL
case SIGABRT
case SIGFPE
case SIGKILL
case SIGBUS
case SIGSEGV
case SIGSYS
case SIGTERM
case SIGCHLD
This what I required.But i dont know to code these signlas to trap.Now i got the solution for this.If u have any valuable suggestion about the code please share with me.

I am very thankful for the answer you given, Its 100% helped me.

Once agian i am very sorry for mistake.

Thanks,
Vijay,

Last edited by bhas85; 08-05-2009 at 08:02 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ps issue

HI All, Suddenly don't know what happened to redhat linux 7.2 any program start then itsn't listing while using ps -ef ex: ./xyz this xyz program pid not showing in ps-ef Pls let me know what is the reason for the same. Thanks a lot in advance Bache (7 Replies)
Discussion started by: bache_gowda
7 Replies

2. Shell Programming and Scripting

Unix Arithmatic operation issue , datatype issue

Hi, I have a shell scripting. This will take 7 digit number in each line and add 7 digit number with next subsequent lines ( normal addition ). Eg: 0000001 0000220 0001235 0000022 0000023 ........... ......... ........ Like this i am having around 1500000 records. After adding... (23 Replies)
Discussion started by: thambi
23 Replies

3. UNIX for Dummies Questions & Answers

ISSUE and ISSUE.NET files

In LINUX(CentOS, RedHat) is there a way to have the banner statement appear before the logon instead of after the logon? In UNIX and Windows the banner appears before a person actually logs on, what I'm seeing in LINUX is that it appears after the login(ftp, telnet, SSH). Thanks (0 Replies)
Discussion started by: ejjones
0 Replies

4. Solaris

IP issue

hi , I have a Solaris server which is part of a domain. The IP for this Solaris box is allocated dyanamically by a DHCP. Everytime the solaris box is restarted the IP gets changed. Being an admin what should i do to find the new ip of the Solaris server sitting at my location? Till now i get... (2 Replies)
Discussion started by: BalajiUthira
2 Replies

5. Shell Programming and Scripting

CP Issue

I want to copy large amount of files aproximately more than 20,000 files from one file system to another file system, but it gives me error like: #cd /opt/appserver/images #cp * /opt/appserver02/public/images Argument list is too long Also above mention error appear again when i run: ... (1 Reply)
Discussion started by: telnor
1 Replies

6. Shell Programming and Scripting

Need assistance with a file issue and a terminal issue

Hello everyone, I'm in need of some assistance. I'm currently enrolled in an introductory UNIX shell programming course and, well halfway through the semester, we are receiving our first actual assignment. I've somewhat realized now that I've fallen behind, and I'm working to get caught up, but for... (1 Reply)
Discussion started by: MrMagoo22
1 Replies

7. Shell Programming and Scripting

Variable value substitution issue with awk command issue

Hi All, I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command. The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies

8. Shell Programming and Scripting

What could be the issue ?

Hi, when i am trying below script assume that below values are taken in code #!/bin/ksh if then echo usage: aNlist.sh QMGR NAME MQREQ fi NL=`echo 'dis qmgr'|runmqsc $1|grep REPOSNL|sed 's/.*REPOSNL\(.*\).*/\1/' |cut -d'(' -f2|cut -d')' -f1` echo 'define nl('$NL_$2')... (25 Replies)
Discussion started by: darling
25 Replies

9. Shell Programming and Scripting

Issue with wc -c and wc -m

Hi All, I have a small queries to get the character count i tried with wc -c and wc -m but its not returend current result For eg: wc -c wc -m echo "Name" | wc -c result: 5 but actually it should returned 4 Help me on this to ge the correct one. Thanks! ----------... (4 Replies)
Discussion started by: siva.pitchai
4 Replies
siginfo.h(3HEAD)						      Headers							  siginfo.h(3HEAD)

NAME
siginfo.h, siginfo - signal generation information SYNOPSIS
#include <siginfo.h> DESCRIPTION
If a process is catching a signal, it might request information that tells why the system generated that signal. See sigaction(2). If a process is monitoring its children, it might receive information that tells why a child changed state. See waitid(2). In either case, the system returns the information in a structure of type siginfo_t, which includes the following information: int si_signo /* signal number */ int si_errno /* error number */ int si_code /* signal code */ union sigval si_value /* signal value */ si_signo contains the system-generated signal number. For the waitid(2) function, si_signo is always SIGCHLD. If si_errno is non-zero, it contains an error number associated with this signal, as defined in <errno.h>. si_code contains a code identifying the cause of the signal. If the value of the si_code member is SI_NOINFO, only the si_signo member of siginfo_t is meaningful, and the value of all other members is unspecified. User Signals If the value of si_code is less than or equal to 0, then the signal was generated by a user process (see kill(2), _lwp_kill(2), sigqueue(3RT), sigsend(2), abort(3C), and raise(3C)) and the siginfo structure contains the following additional information: pid_t si_pid /* sending process ID */ uid_t si_uid /* sending user ID */ ctid_t si_ctid /* sending contract ID */ zoneid_t si_zoneid /* sending zone ID */S If the signal was generated by a user process, the following values are defined for si_code: SI_USER The implementation sets si_code to SI_USER if the signal was sent by kill(2), sigsend(2), raise(3C) or abort(3C). SI_LWP The signal was sent by _lwp_kill(2). SI_QUEUE The signal was sent by sigqueue(3RT). SI_TIMER The signal was generated by the expiration of a timer created by timer_settime(3RT). SI_ASYNCIO The signal was generated by the completion of an asynchronous I/O request. SI_MESGQ The signal was generated by the arrival of a message on an empty message queue. See mq_notify(3RT). si_value contains the application specified value, which is passed to the application's signal-catching function at the time of the signal delivery if si_code is any of SI_QUEUE, SI_TIMER, SI_ASYNCHIO, or SI_MESGQ. System Signals Non-user generated signals can arise for a number of reasons. For all of these cases, si_code contains a positive value reflecting the rea- son why the system generated the signal: Signal Code Reason SIGILL ILL_ILLOPC illegal opcode ILL_ILLOPN illegal operand ILL_ILLADR illegal addressing mode ILL_ILLTRP illegal trap ILL_PRVOPC privileged opcode ILL_PRVREG privileged register ILL_COPROC co-processor error ILL_BADSTK internal stack error SIGFPE FPE_INTDIV integer divide by zero FPE_INTOVF integer overflow FPE_FLTDIV floating point divide by zero FPE_FLTOVF floating point overflow FPE_FLTUND floating point underflow FPE_FLTRES floating point inexact result FPE_FLTINV invalid floating point operation FPE_FLTSUB subscript out of range SIGSEGV SEGV_MAPERR address not mapped to object SEGV_ACCERR invalid permissions for mapped object SIGBUS BUS_ADRALN invalid address alignment BUS_ADRERR non-existent physical address BUS_OBJERR object specific hardware error SIGTRAP TRAP_BRKPT process breakpoint TRAP_TRACE process trace trap SIGCHLD CLD_EXITED child has exited CLD_KILLED child was killed CLD_DUMPED child terminated abnormally CLD_TRAPPED traced child has trapped CLD_STOPPED child has stopped CLD_CONTINUED stopped child had continued SIGPOLL POLL_IN data input available POLL_OUT output buffers available POLL_MSG input message available POLL_ERR I/O error POLL_PRI high priority input available POLL_HUP device disconnected Signals can also be generated from the resource control subsystem. Where these signals do not already possess kernel-level siginfo codes, the siginfo si_code will be filled with SI_RCTL to indicate a kernel-generated signal from an established resource control value. Signal Code Reason SIGXRES SI_RCTL resource-control generated signal SIGHUP SIGTERM The uncatchable signals SIGSTOP and SIGKILL have undefined siginfo codes. Signals sent with a siginfo code of SI_RCTL contain code-dependent information for kernel-generated signals: Code Field Value SI_RCTL hr_time si_entity process-model entity of control In addition, the following signal-dependent information is available for kernel-generated signals: Signal Field Value SIGILL caddr_t si_addr address of faulting instruction SIGFPE SIGSEGV caddr_t si_addr address of faulting memory ref- erence SIGBUS SIGCHLD pid_t si_pid child process ID int si_status exit value or signal SIGPOLL long si_band band event for POLL_IN, POLL_OUT, or POLL_MSG SEE ALSO
_lwp_kill(2), kill(2), setrctl(2), sigaction(2), sigsend(2), waitid(2), abort(3C), aio_read(3RT), mq_notify(3RT), raise(3C), sig- nal.h(3HEAD), sigqueue(3RT), timer_create(3RT), timer_settime(3RT) NOTES
For SIGCHLD signals, if si_code is equal to CLD_EXITED, then si_status is equal to the exit value of the process; otherwise, it is equal to the signal that caused the process to change state. For some implementations, the exact value of si_addr might not be available; in that case, si_addr is guaranteed to be on the same page as the faulting instruction or memory reference. SunOS 5.10 19 Jul 2004 siginfo.h(3HEAD)
All times are GMT -4. The time now is 02:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy