Sponsored Content
Top Forums Shell Programming and Scripting how to exit status of a piped process ??? Post 302554221 by ashwini.engr07 on Saturday 10th of September 2011 10:29:56 PM
Old 09-10-2011
Thanks binlib. Yes I'm aware of the PIPESTATUS array. But it works only with piped foreground processes and not background ones.

I want the processes to run in background because I want them to be interrupted when a user presses ctrl+c... if it runs in foreground, it'll get the higher priority and won't stop until it finishes even though user has interrupted it.

This is the reason for wanting it to run in background.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

exit status

i downloaded a text file from metalab.unc.edu called sh.txt and in this reference manual it refers to shell scripting exit status .. at the end of one of the examples that author gave an exit status of 127.. to what does a 127 exit status refer too and what is its purpose in the code. moxxx68 (1 Reply)
Discussion started by: moxxx68
1 Replies

2. Shell Programming and Scripting

exit status for isql

I'm trying to write a script that will update a table in sysbase. If it's failed then I want to rerun it one more time before exiting the script (fail due to bad value such as trying to put a string into datetime field or bad connection to the database) Well my code below will always return... (2 Replies)
Discussion started by: sirrtuan
2 Replies

3. Shell Programming and Scripting

How to get the exit status

Hi all, I'm running a program which return 1 upon success. But when encounters problem shell return 's '1' . How to differentiate between them the shell return value and script return value. Ex. function fn return '1' if executed successfully and '0' if failed. But when if shell encounters... (1 Reply)
Discussion started by: yhacks
1 Replies

4. Shell Programming and Scripting

Exit status

I'm preparing for exam and one of exams is to write own test command... I wonder if in unix is a command which just returns exit code you specify.. I know I can easily write a function like this: exStatus() { return $1 } -> my question is rather theoretical thank you! (9 Replies)
Discussion started by: MartyIX
9 Replies

5. Shell Programming and Scripting

Exit status of grep

I am trying to get the exit status of grep and test a condition with it, But it does not seem to be working as expected since i am doing something wrong apparently as per grep help Exit status is 0 if match, 1 if no match, and 2 if trouble. My problem is something like this templine - a... (7 Replies)
Discussion started by: prasbala
7 Replies

6. Shell Programming and Scripting

Exit status redirection

Hi, I'm having this simple code below, the file serverlist has a list of IPs one per line. When executed the while loop is executed only once, after that the program terminates. How should i redirect the exit status, so that the entire list of IP will get executed? #!/bin/bash exec <... (4 Replies)
Discussion started by: agent001
4 Replies

7. Shell Programming and Scripting

Unable to find exit status of piped command

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 | (12 Replies)
Discussion started by: proactiveaditya
12 Replies

8. Shell Programming and Scripting

Exit Status

I have a shell script (#!/bin/sh) that interacts with Appworx and Banner Admin. In my script I want to check the exit status of awrun before continuing. awrun can run for 10 seconds or it can run for over a minute. So my question is, will it go through my if statement before awrun may even be... (2 Replies)
Discussion started by: smkremer
2 Replies

9. Shell Programming and Scripting

SSH Process monitoring and Exit Status evaluation

Hi All, I have a peculiar requirement as follows, I have a some hosts on which i have to run a script, so i am using the following code piece for i in $HOSTLIST do ssh ${i} "~/task.sh" done Now i want to run this same thing in parallel on all the hosts and then monitor the ssh process... (1 Reply)
Discussion started by: mihirvora16
1 Replies

10. Shell Programming and Scripting

Want to get the exit status

Hi All, I am trying to create a zip file with all the txt files(these are in large number) in the current directory. I am able to do this operation sucessfully. After this i want to get the status of the tar command executed and do accordingly. When i am trying with the below code, the status... (3 Replies)
Discussion started by: paddu
3 Replies
XSetState(3X11) 						  XLIB FUNCTIONS						   XSetState(3X11)

NAME
XSetState, XSetFunction, XSetPlaneMask, XSetForeground, XSetBackground - GC convenience routines SYNTAX
XSetState(display, gc, foreground, background, function, plane_mask) Display *display; GC gc; unsigned long foreground, background; int function; unsigned long plane_mask; XSetFunction(display, gc, function) Display *display; GC gc; int function; XSetPlaneMask(display, gc, plane_mask) Display *display; GC gc; unsigned long plane_mask; XSetForeground(display, gc, foreground) Display *display; GC gc; unsigned long foreground; XSetBackground(display, gc, background) Display *display; GC gc; unsigned long background; ARGUMENTS
background Specifies the background you want to set for the specified GC. display Specifies the connection to the X server. foreground Specifies the foreground you want to set for the specified GC. function Specifies the function you want to set for the specified GC. gc Specifies the GC. plane_mask Specifies the plane mask. DESCRIPTION
The XSetState function sets the foreground, background, plane mask, and function components for the specified GC. XSetState can generate BadAlloc, BadGC, and BadValue errors. XSetFunction sets a specified value in the specified GC. XSetFunction can generate BadAlloc, BadGC, and BadValue errors. The XSetPlaneMask function sets the plane mask in the specified GC. XSetPlaneMask can generate BadAlloc and BadGC errors. The XSetForeground function sets the foreground in the specified GC. XSetForeground can generate BadAlloc and BadGC errors. The XSetBackground function sets the background in the specified GC. XSetBackground can generate BadAlloc and BadGC errors. DIAGNOSTICS
BadAlloc The server failed to allocate the requested resource or server memory. BadGC A value for a GContext argument does not name a defined GContext. BadValue Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argu- ment, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. SEE ALSO
XCreateGC(3X11), XQueryBestSize(3X11), XSetArcMode(3X11), XSetClipOrigin(3X11), XSetFillStyle(3X11), XSetFont(3X11), XSetLineAt- tributes(3X11), XSetTile(3X11) Xlib - C Language X Interface X Version 11 Release 6.6 XSetState(3X11)
All times are GMT -4. The time now is 02:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy