Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Command line works

by eye (Chaplain)
on Mar 04, 2009 at 06:20 UTC ( #748005=note: print w/ replies, xml ) Need Help??


in reply to Command line works

Consider what we want to do:

cd ../../;. setup-env

In this snippet, the "cd" only serves to locate the file "setup-env". The dot (".") says to read the file and execute its commands in the current shell. Since we don't have a current shell, we can specify one explicitly ("sh" in this case):

my $retval = qx{ sh < ../../setup-env };

or use the default shell:

my $retval = qx{ . ../../setup-env };

Keep in mind that the default shell may not be your login shell.


Comment on Re: Command line works
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://748005]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (17)
As of 2015-07-07 15:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (90 votes), past polls