Re: system ("cd ..")
- From: eliyah_kilada@xxxxxxxxxx (Eliyah Kilada)
- Date: Mon, 29 Aug 2005 17:19:52 +0300
Hi,
How can I access a specific child process, such that I put all my system commands in one child process?
Thanks alot Eliyah
Bob Showalter wrote:
Eliyah Kilada wrote:
Hi, It seems that the following code gives unexpected results:
system ("cd $dir_name");
system ("pwd");
---> this prints the old directory name not the new one. In other
words, the previous (cd) command hasn't taken its effect!
Do anyone know why?
Each call to system() creates a separate process in which the command is executed. The cd command only affects that separate process.
You need to use Perl's chdir() function to change the working directory for
the current process.
.
- Follow-Ups:
- Re: system ("cd ..")
- From: Jeff 'japhy' Pinyan
- Re: system ("cd ..")
- References:
- RE: system ("cd ..")
- From: Bob Showalter
- RE: system ("cd ..")
- Prev by Date: RE: Directories into arrays, again.
- Next by Date: Re: File downloads when I try mod_perl redirect
- Previous by thread: RE: system ("cd ..")
- Next by thread: Re: system ("cd ..")
- Index(es):
Relevant Pages
|
|