![]() |
|
|
|
|
|||||||
| 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 08:17 PM |
| to kill a process in perl | gurukottur | Shell Programming and Scripting | 2 | 11-20-2006 01:01 AM |
| My "Bread and Butter" Process Keep Alive Perl Script.... | Neo | Tips and Tutorials | 0 | 01-08-2005 02: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 | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
You would like the Perl script chdir() to affect the parent shell process? That is impossible in this case as exec() won't return, so when the Perl script ends, the original shell process also ends.
I'm sorry that I have probably misunderstood your question. I would say the method is only for the original process image (shell script in your case) affecting the later, replaced process image (the Perl script in your case), and doesn't work if you expect the parent environment to be influenced after exec(), as it won't return at all. |
| Forum Sponsor | ||
|
|
|
#9
|
||||
|
||||
|
So, as I understand, whatever the perl script does will not affect the parent shell.
Say, in this case, after I change to the new directory, I cant remain in that new directory even after the perl script exits. Right ? |
|
#10
|
|||
|
|||
|
Absolutely correct. What you are asking: 'Can I source a file from inside perl?'
No. Because you have to call exec. This is exactly the same problem you have with shell scripts doing a cd and then exiting. |
|
#11
|
||||
|
||||
|
Thanks Jim.
Vino |
||||
| Google The UNIX and Linux Forums |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|