![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling a perl script from a perl script | new2ss | Shell Programming and Scripting | 6 | 05-24-2009 05:03 PM |
| to kill a process in perl | gurukottur | Shell Programming and Scripting | 2 | 11-20-2006 04:01 AM |
| My "Bread and Butter" Process Keep Alive Perl Script.... | Neo | Tips and Tutorials | 0 | 01-08-2005 05:17 AM |
| PERL: wait for process to complete | dangral | Shell Programming and Scripting | 2 | 04-21-2004 03:37 PM |
| Killing a process from perl script. | sharuvman | Shell Programming and Scripting | 3 | 04-01-2004 12:10 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||||
|
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 08: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 |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|