Sponsored Content
Top Forums Shell Programming and Scripting How to return control from the child script to the parent one? Post 302205819 by danmero on Monday 16th of June 2008 11:05:46 AM
Old 06-16-2008
Quote:
Originally Posted by manas_ranjan
This one is my assumption .
Bad assumption, please try before you buy Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

return valuse from child script to parent script

Hi, I am trying to return a value from child script to a parent script just as a function does. The child script will look for a file and if exists will return 1 else 0. I need to capture the status 1 from child script in the parent script and proceed further. if 0, i need not do... (1 Reply)
Discussion started by: borncrazy
1 Replies

2. Shell Programming and Scripting

Parent/child Korn shell script help

I have the following two Korn shell scripts: SHELL1.ksh #!/usr/bin/ksh nohup sas /abc/123/sasprogram1.sas & SHELL2.ksh #!/usr/bin/ksh ./SHELL1.ksh wait nohup sas /abc/123/sasprogram2.sas & My goal is to run SHELL1.ksh within SHELL2.ksh. SHELL1.ksh runs sasprogram1.sas. I would like... (1 Reply)
Discussion started by: sasaliasim
1 Replies

3. Shell Programming and Scripting

Passing a variable from a child script back to the parent

Hi I have written a script using ftp to get files from one server and copy them to 2 dirrerent servers. I wish to call this script from a parent script that will check the number of files copied and run a check sum for each file. As the filenames for the files in the get portion of the script... (3 Replies)
Discussion started by: Andy82
3 Replies

4. Shell Programming and Scripting

Script, child kills parent

Hello everyone, I'm trying to write a script, i would like to say the child kills the parent, how would i do that? (2 Replies)
Discussion started by: jessy21
2 Replies

5. Programming

getting the return from forked child process to parent in C++

This needs to work on HPUX and Linux. I do a fork and create a child process. During execution of the child process, it is possible child become lost or get killed. That is the reason why I create the child process. However if the child process doesnt get killed, I do want to know the return... (2 Replies)
Discussion started by: usustarr
2 Replies

6. Shell Programming and Scripting

forking a child process and kill its parent to show that child process has init() as its parent

Hi everyone i am very new to linux , working on bash shell. I am trying to solve the given problem 1. Create a process and then create children using fork 2. Check the Status of the application for successful running. 3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies

7. UNIX for Dummies Questions & Answers

Why is the return code of child required by parent ?

Hello everyone, I am a complete newbie to UNIX. I am using Debian LXDE 64-bit. I have a question regarding the child and parent process communication. According to wikipedia.org and various other sources, when a child process exits it sends the SIGCHLD signal to its parent... (1 Reply)
Discussion started by: sreyan32
1 Replies

8. Shell Programming and Scripting

Child exiting and not returning to parent script

I am having a parent scripts which reads a file with child scripts name. I need to read one by one child script , execute it and 1. If child script fails send mail to the team with the log file 2. If the child script executes fine then proceed with the next child script execution. #!... (3 Replies)
Discussion started by: nw2unx123
3 Replies

9. Shell Programming and Scripting

How to exit from the parent script while the child is running?

hi, i want to call a child shell script from a parent shell script. the child will be running for 5 mins. normally when the child is running, parent will wait till the child completes. so in the above case parent will be paused for 5 mins. is there a way so that the parents does not wait for the... (3 Replies)
Discussion started by: Little
3 Replies

10. Shell Programming and Scripting

Fail Parent Script if any of the child fails

I have requirement where I need to fail parent if any one of the child process fails. Here is the code snippet for i in 1 2 3 4 5 6 7 8 9 10 do child_script $i & done wait I need to fail my main script if any one of my child process fails (8 Replies)
Discussion started by: gvkumar25
8 Replies
escape(1)							Mail Avenger 0.8.3							 escape(1)

NAME
escape - escape shell special characters in a string SYNOPSIS
escape string DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result. EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string: $ var='; echo gotcha!' $ eval echo hi $var hi gotcha! $ Using escape, one can avoid executing the contents of $var: $ eval echo hi `escape "$var"` hi ; echo gotcha! $ A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient: #!/bin/sh formail -x to -x cc -x resent-to -x resent-cc | fgrep "$1" > /dev/null && exit 0 echo "<$1>.. address does not accept blind carbon copies" exit 100 To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt script: bodytest reject_bcc `escape "$RECIPIENT"` SEE ALSO
avenger(1), The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 escape(1)
All times are GMT -4. The time now is 12:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy