Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: System() in list mode?

by onelesd (Pilgrim)
on Oct 17, 2011 at 21:45 UTC ( #932018=note: print w/ replies, xml ) Need Help??


in reply to Re^2: System() in list mode?
in thread System() in list mode?

There is no shell in LIST mode so setting a PATH variable doesn't have the effect you are looking for. You need to provide full paths to files/binaries, such as /bin/bash.

Edit:

No need to be an a$$ to people taking time out of their lives to help you.


Comment on Re^3: System() in list mode?
Download Code
Re^4: System() in list mode?
by 1337John (Initiate) on Oct 17, 2011 at 21:49 UTC

    So then how would you use system() if your program's path name has spaces in it?

      You can use $WHAT in foo.sh like this. Notice the space.

      system('env', 'WHAT=bar', '/Users/onelesd/Work/space/a space/foo.sh') ;

        But I can't use PATH... Which makes no sense if there is absolutely no shell interaction. I also do notice that space, that's exactly why I'm trying to get this working. The problem I have is setting an environment variable called PATH because my script uses it. I don't really care much for a variable called WHAT. And rewriting the script is not an option.

        P.s. thanks for the help so far!
Re^4: System() in list mode?
by 1337John (Initiate) on Oct 17, 2011 at 21:50 UTC
    So how would you use system() when your program's path has spaces in it?
        ...... Hm I'm not sure but if you could give me an example, then maybe it'll make more sense.
Re^4: System() in list mode?
by 1337John (Initiate) on Oct 17, 2011 at 21:57 UTC
    From what I've read it seems as though I'm supposed to use LIST mode?

      There's no "supposed to" about it.

      Use the multi-arg form if you want to run a program.
      Use the single-arg form if you want to execute a shell command.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-12-27 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls