![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling a perl script from a perl script | new2ss | Shell Programming and Scripting | 3 | 02-06-2007 07:17 PM |
| to kill a process in perl | gurukottur | Shell Programming and Scripting | 2 | 11-20-2006 12:01 AM |
| My "Bread and Butter" Process Keep Alive Perl Script.... | Neo | Tips and Tutorials | 0 | 01-08-2005 01:17 AM |
| PERL: wait for process to complete | dangral | Shell Programming and Scripting | 2 | 04-21-2004 12:37 PM |
| Killing a process from perl script. | sharuvman | Shell Programming and Scripting | 3 | 04-01-2004 09:10 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
| Forum Sponsor | ||
|
|
|
||||
|
Quote:
I am curious to know if it can be done this way. Thanks, vino |
|
|||
|
The "exec" builtin in bash (sh on Linux seems to be too) will run the perl process without creating a new process by replacing the original shell process, just like the C exec* family of functions.
So you ought to be able to run a script by "./script.sh" to create a new process and then "exec perl script.pl" to continue execution without introducing a new process, but the original shell script will terminate (control will not return to the shell script). Last edited by cbkihong; 12-07-2005 at 04:52 PM. |
|
||||
|
Quote:
Code:
# ls -l /bin/sh /bin/bash -rwxr-xr-x 1 root root 616312 Dec 7 2004 /bin/bash lrwxrwxrwx 1 root root 4 May 18 2005 /bin/sh -> bash |
|
||||
|
Quote:
Code:
sh-2.05b$ pwd
/tmp
sh-2.05b$ cat test.sh
#! /bin/sh
exec perl /tmp/test.pl
sh-2.05b$ cat test.pl
chdir("/etc");
sh-2.05b$ ./test.sh
sh-2.05b$ pwd
/tmp
sh-2.05b$
I changed test.pl to contain Code:
#! usr/bin/perl
chdir("/etc");
Code:
#! /bin/sh exec /tmp/test.pl vino |
||||
| Google The UNIX and Linux Forums |
| Tags |
| linux |
| Thread Tools | |
| Display Modes | |
|
|