Sponsored Content
Top Forums Shell Programming and Scripting Unable to find exit status of piped command Post 302559429 by proactiveaditya on Tuesday 27th of September 2011 04:53:46 AM
Old 09-27-2011
Unable to find exit status of piped command

HTML Code:
Lois_Answer_Code=`sipsak -vv -s sip:192.168.1.3|grep -A 1 "reply received after"|grep SIP|awk '{print $2}'`
How to find the exit status of
Quote:
sipsak -vv -s sip:192.168.1.3
|
 

10 More Discussions You Might Find Interesting

1. Programming

How to find the exit status of last command in Unix?

Hi, I want to find the exit status of the last executed command in C Shell. Tried $? but getting the error Variable syntax...$? does not seem to work in C shell.. is there any other command in C shell to find the exit status of last command? Thanks in advance, raju (1 Reply)
Discussion started by: rajugp1
1 Replies

2. UNIX for Dummies Questions & Answers

how to find the exit status for the last executed command

I am executing a find command in my script i.e find $2 -type f -name '*.gif' -mtime +$1 -exec rm {} \; how do i check that this command is executed properly.. i would lke t trap the errror and display my error message kinly help.. this is an urgent issue. (1 Reply)
Discussion started by: vijay.amirthraj
1 Replies

3. Shell Programming and Scripting

Getting the exit status of a remote command

Hi to everyone. How can I get the exit status from a remote command executed with rexec? :eek: machine A has RedHat Linux 9 and the remote machine B has SCO UNIX. Code: rexec -l user -p password host sh /u/files/scripts/seq_cal.sh 2006 08 I want the exit status returned by... (1 Reply)
Discussion started by: zoonalex
1 Replies

4. UNIX for Dummies Questions & Answers

Move Command and exit status problem

Hi All, I am using the following code to move files from one folder to another on the remote server: ssh username@server <<EOF cd source_dir find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir if then send mail indicating error otherwise echo "success" fi EOF ... (1 Reply)
Discussion started by: visingha
1 Replies

5. Shell Programming and Scripting

Find exit status problem

Hi All Its strange or i am doing it wrong.When find run successful it return exit status 0.And same if it didn't run successfully it return zero. find /var/www/html -maxdepth 1 -type f -name *.dsadas echo $? 0 find /var/www/html -maxdepth 1 -type f -name *.php... (1 Reply)
Discussion started by: aliahsan81
1 Replies

6. HP-UX

Logins command exit status is 236 not 0

I have noticed that on version 11.23 I get exit status 236 from the following command: logins -oxl root ; echo $? > 236 However on 11.31 I get the expected code 0 logins -oxl root ; echo $? > 0 The output is correct for both versions and contains no error data. Can anyone explain... (2 Replies)
Discussion started by: parkea2
2 Replies

7. UNIX for Advanced & Expert Users

Equivalents of tee command to find exit status of command

Hi, Want to log the output of command & check the exit status to find whether it succeeded or failed. > ls abc ls: abc: No such file or directory > echo $? 1 > ls abc 2>&1 | tee log ls: abc: No such file or directory > echo $? 0 Tee commands changes my exit status to be always... (7 Replies)
Discussion started by: vibhor_agarwali
7 Replies

8. Shell Programming and Scripting

how to exit status of a piped process ???

Hi, I've searched the related threads both in this forum and others in google and found the solution to be working too in most of the places. But somehow it's not working for me. $cmd | tee -a $LOGFILE & pid=$! wait ${pid} ret=$? echo "$ret" I want the exit status of the $cmd.... (8 Replies)
Discussion started by: ashwini.engr07
8 Replies

9. UNIX for Dummies Questions & Answers

Exit Status Of Find Command

Hello All, I am trying to capture the exit status of find command and want to delete the files only when it is successful. But it is always returning me as success even if the pattern of that file doesn't exist in the current directory. please help, checked manual page but couldn't able to figure... (6 Replies)
Discussion started by: Ariean
6 Replies

10. Shell Programming and Scripting

Exit Status of Command

Hi All, I am doing an export and import (datapump) of 4 schema. I know we can do an export of 4 schema in one command. But just want to know how to check the exit status if i do the export/import of 4 schema in different commands in background. Please suggest. Thanks, Mani (1 Reply)
Discussion started by: pvmanikandan
1 Replies
sip_enable_trans_logging(3SIP)			   Session Initiation Protocol Library Functions		    sip_enable_trans_logging(3SIP)

NAME
sip_enable_trans_logging, sip_enable_dialog_logging, sip_disable_dialog_logging, sip_disable_trans_logging - transaction and dialog logging operations SYNOPSIS
cc [ flag... ] file... -lsip [ library... ] #include <sip.h> int sip_enable_trans_logging(FILE *logfile, int flags); int sip_enable_dialog_logging(FILE *logfile, int flags); void sip_disable_dialog_logging(); void sip_disable_trans_logging(); DESCRIPTION
The sip_enable_trans_logging() and sip_enable_dialog_logging() functions enable transaction and dialog logging respectively. The logfile argument points to a file to which the SIP messages are logged. The flags argument controls the amount of logging. The only flag defined in <sip.h> is SIP_DETAIL_LOGGING. Either transaction or dialog logging, or both, can be enabled at any time. For dialog logging to work, the SIP stack must be enabled to manage dialogs (using SIP_STACK_DIALOGS, see sip_stack_init(3SIP)) when the stack is initialized. All the messages exchanged within a transaction/dialog is captured and later dumped to a log file when the transaction or dialog is deleted or terminated. Upon termination, each dialog writes to the file the messages that were processed in its context. Similarly, upon termina- tion each transaction writes to the file the messages that were processed in its context. The sip_disable_trans_logging() and sip_disable_dialog_logging() functions disable the transaction or dialog logging. These functions do not close the files. It is the responsibility of the application to close them. The log contains the state of the transaction or dialog at the time the message was processed. RETURN VALUES
Upon successful completion, sip_enable_trans_logging() and sip_enable_dialog_logging() return 0. They return EINVAL if logfile is NULL or flags is unrecognized. EXAMPLES
Example 1 Dialog logging The following is an example of dialog logging. FILE *logfile; logfile = fopen("/tmp/ApplicationA", "a+"); sip_enable_dialog_logging(logfile, SIP_DETAIL_LOGGING); /* Application sends INVITE, recieves 180 and 200 response and dialog is created. */ /* Application sends ACK request */ /* Application sends BYE and recieves 200 response */ /* Application disables logging */ sip_disable_dialog_logging(); The log file will be of the following format. ************* Begin Dialog ************* Digest : 43854 43825 26120 9475 5415 21595 25658 18538 ----------------------------- Dialog State : SIP_DLG_NEW Tue Nov 27 15:53:34 2007| Message - 1 INVITE sip:user@example.com SIP/2.0 From: "Me" < sip:me@mydomain.com > ; TAG=tag-from-01 To: "You" < sip:you@yourdomain.com > Contact: < sip:myhome.host.com > MAX-FORWARDS: 70 Call-ID: 1261K6A6492KF33549XM CSeq: 111 INVITE CONTENT-TYPE: application/sdp Via: SIP/2.0/UDP 192.0.0.1 : 5060 ;branch=z9hG4bK-via-EVERYTHINGIDO-05 Record-Route: <sip:server1.com;lr> Record-Route: <sip:server2.com;lr> CONTENT-LENGTH : 0 Tue Nov 27 15:53:34 2007| Message - 2 SIP/2.0 180 Ringing Via: SIP/2.0/UDP 192.0.0.1 : 5060 ;branch=z9hG4bK-via-EVERYTHINGIDO-05 From: "Me" < sip:me@mydomain.com > ; TAG=tag-from-01 To: "You" < sip:you@yourdomain.com >;tag=1 Call-ID: 1261K6A6492KF33549XM CSeq: 111 INVITE Contact: <sip:whitestar2-0.East.Sun.COM:5060;transport=UDP> Record-Route: <sip:server1.com;lr> Record-Route: <sip:server2.com;lr> Content-Length: 0 ----------------------------- Dialog State : SIP_DLG_EARLY /* Entire 200 OK SIP Response */ ----------------------------- Dialog State : SIP_DLG_CONFIRMED /* Entire ACK Request */ /* Entire BYE Request */ /* Entire 200 OK Response */ ----------------------------- ************* End Dialog ************* ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
sip_stack_init(3SIP), attributes(5) SunOS 5.11 11 Jan 2008 sip_enable_trans_logging(3SIP)
All times are GMT -4. The time now is 02:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy