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:
set an unix alias from perl script

 



lsy
Novice

May 8, 2013, 2:15 AM

Post #1 of 4 (245 views)
set an unix alias from perl script Can't Post

how can i set an unix alias from perl script?


Laurent_R
Enthusiast / Moderator

May 8, 2013, 4:13 AM

Post #2 of 4 (243 views)
Re: [lsy] set an unix alias from perl script [In reply to] Can't Post

What do you really want to do?

If you want to use a Perl script to modify permanently the parent Unix environment, I am afraid this can't be done in Perl.

If you want to modify an environment variable for later use in your Perl program, you can modify the %ENV hash for the particular environment variable that you want to modify.


lsy
Novice

May 8, 2013, 7:33 PM

Post #3 of 4 (232 views)
Re: [Laurent_R] set an unix alias from perl script [In reply to] Can't Post


In Reply To
What do you really want to do?

If you want to use a Perl script to modify permanently the parent Unix environment, I am afraid this can't be done in Perl.

If you want to modify an environment variable for later use in your Perl program, you can modify the %ENV hash for the particular environment variable that you want to modify.

i want to set an alias in my environment. is it possible?


Laurent_R
Enthusiast / Moderator

May 9, 2013, 1:59 AM

Post #4 of 4 (227 views)
Re: [lsy] set an unix alias from perl script [In reply to] Can't Post


In Reply To

In Reply To
What do you really want to do?

If you want to use a Perl script to modify permanently the parent Unix environment, I am afraid this can't be done in Perl.

If you want to modify an environment variable for later use in your Perl program, you can modify the %ENV hash for the particular environment variable that you want to modify.

i want to set an alias in my environment. is it possible?


You did not really answer the questions.

It is possible to modify your own execution environment (and the environment of subprocesses or threads that you may start off), but it is not possible to modify the parent environment, because, in *nix, your process is essentially running in a copy of the parent environment. Whenever you change the environment, you alter your own copy of the environment, but never the parent environment itself.

 
 


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

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