CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
change current directory in a shell

 



alexb
Novice

Jan 19, 2011, 5:49 AM

Post #1 of 2 (553 views)
change current directory in a shell Can't Post

Hello,

I am trying to change the current working directory of the shell (not chdir, which changes the directory only within the script).
I have tried "system(cd "..")", but with no luck.
Is there a way to make it change directory in the shell, so I could see in my shell that the directory have been changed ?

Thanks in advance,

Alex


BillKSmith
Veteran

Jan 19, 2011, 8:09 PM

Post #2 of 2 (548 views)
Re: [alexb] change current directory in a shell [In reply to] Can't Post

The short answer is 'NO'. This is not a perl problem, it cannot even be done with a shell script or windows .bat script. In general, variables set by a script cannot be passed back to the calling program. The current or working directory is not not a special case. If you explain why you want to do this, perhaps we can suggest a way to solve your real problem.
Good Luck,
Bill

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives