Sponsored Content
Full Discussion: Stopping a shell script
Top Forums UNIX for Dummies Questions & Answers Stopping a shell script Post 302153934 by jadionne on Thursday 27th of December 2007 10:06:02 AM
Old 12-27-2007
Quote:
Originally Posted by mehmet_demirez
Use exit with an exit code to indicate success or failure
0 : success
anything but 0 : failure
I have neaver set up error traping before. Can you give me a simple example?
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Stopping a print request

Im running a solaris 9 system and keep getting this message: Request to LXKF894CB (unknown printer) from zion. This happen because there was a mis configured printer and a job was submitted to it. I fix the printer issue but this message keeps repeating and the PID keeps going up. How can i... (5 Replies)
Discussion started by: meyersp
5 Replies

2. Shell Programming and Scripting

stopping a script

i want to stop a script from running after one minute, using the sleep command, and then kill the process. anyhelp with this. (2 Replies)
Discussion started by: AtomJ22
2 Replies

3. UNIX for Advanced & Expert Users

stopping a processor

hi, Can any plz tell what is the command for stopping a processor? suppose a system is accessing 10 processors and we want to stop the 3rd & 6th processor then whats the command in Unix? thank u (2 Replies)
Discussion started by: nm_virtual
2 Replies

4. Shell Programming and Scripting

Stopping a command in between

Hi Is it possible to stop a command executing after certain time? I have this command say prstat which keeps on giving the values etc of the processes after every 1 sec(refreshes the screen) What I want is just stop the execution after first screen Since I have written this command in shell... (3 Replies)
Discussion started by: superprg
3 Replies

5. Shell Programming and Scripting

Stopping A process

Hi I want to stop a process using a shell script. how do i do that? ie, to simulate ps -ef|grep Process name get the process id and kill -9 process id plz help... (4 Replies)
Discussion started by: gopsman
4 Replies

6. UNIX Desktop Questions & Answers

stopping running process

hi all, I am using red hat AS 4 linux enterprise,i need to run my application such that while its running no other process shuld run all the remaining process should be suspended ,i need to use whole of the process only for that application to run ,can anyone suggest me how to do this. ... (3 Replies)
Discussion started by: srilakshmi
3 Replies

7. Red Hat

stopping you have mail.....

Hi, on server Red Hat Enterprise Linux AS release 3, I am getting the mail "you have mail" can any body suggest how to stop this? mail are getting generated in below path. /var/spool/postfix/maildrop, due to which heavy file are getting generated. though sendmail service is stopped. ... (0 Replies)
Discussion started by: manoj.solaris
0 Replies

8. Shell Programming and Scripting

Stopping cron job

Hi, I have scheduled one job in crontab. I want to stop the job automatically after some time of its execution without killing it. Could i archive the above? (8 Replies)
Discussion started by: mehulleo
8 Replies

9. Windows & DOS: Issues & Discussions

Stopping Windows 10 Clients?

As I know you are all aware Windows 10 poses some serious security concerns. My question is three fold. 1. Is there a way to stop Windows 10 clients from accessing a web server? 2. What would be the MS counter punch to that? ie: how would they circumvent. (mask browser credentials?) 3. Is... (4 Replies)
Discussion started by: ScottyPC
4 Replies
explain_pclose_or_die(3)				     Library Functions Manual					  explain_pclose_or_die(3)

NAME
explain_pclose_or_die - process I/O and report errors SYNOPSIS
#include <libexplain/pclose.h> int explain_pclose_or_die(FILE *fp); int explain_pclose_success(FILE *fp); void explain_pclose_success_or_die(FILE *fp); DESCRIPTION
These functions may be used to wait for program termination, and then reprt errors returned by the pclose(3) system call. explain_pclose_or_die int explain_pclose_or_die(FILE *fp); The explain_pclose_or_die function is used to call the pclose(3) system call. On failure an explanation will be printed to stderr, obtained from explain_pclose(3), and then the process terminates by calling exit(EXIT_FAILURE). This function is intended to be used in a fashion similar to the following example: int status = explain_pclose_or_die(fp); fp The fp, exactly as to be passed to the pclose(3) system call. Returns: This function only returns on success, see pclose(3) for more information. On failure, prints an explanation and exits. explain_pclose_success_or_die void explain_pclose_success_or_die(FILE *); The explain_pclose_success_or_die function is used to call the pclose(3) system call. On failure, including any exit status other than EXIT_SUCCESS, an explanation will be printed to stderr, obtained from explain_pclose(3), and then the process terminates by calling exit(EXIT_FAILURE). This function is intended to be used in a fashion similar to the following example: explain_pclose_success_or_die(fp); fp The fp, exactly as to be passed to the pclose(3) system call. Returns: This function only returns on success. On failure, prints an explanation and exits. explain_pclose_success int explain_pclose_success(FILE *fp); The explain_pclose_success function is used to call the pclose(3) system call. On failure, including any exit status other than EXIT_SUC- CESS, an explanation will be printed to stderr, obtained from explain_pclose(3). However, the priniting of an error message does not also cause exit(2) to be called. This function is intended to be used in a fashion similar to the following example: int status = explain_pclose_success(command); fp The fp, exactly as to be passed to the pclose(3) system call. Returns: the value returned by the pclose(3) system call. In all cases other than EXIT_SUCCESS, an error message will also have been printed to stderr. SEE ALSO
pclose(3) process I/O explain_pclose(3) explain pclose(3) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller explain_pclose_or_die(3)
All times are GMT -4. The time now is 10:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy