Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: getting a problem when I use which command with system function

by msk_0984 (Friar)
on Nov 03, 2006 at 05:17 UTC ( #582008=note: print w/replies, xml ) Need Help??


in reply to getting a problem when I use which command with system function

Hi

Actually i am not getting any error i am able to get the output perfectly.

#!/usr/bin/perl print " HELLO \n"; system( " which ls ");

OUTPUT

HELLO /bin/ls


Work Hard Party Harderrr!!
Sushil Kumar
  • Comment on Re: getting a problem when I use which command with system function
  • Download Code

Replies are listed 'Best First'.
Re^2: getting a problem when I use which command with system function
by jbrugger (Parson) on Nov 03, 2006 at 05:42 UTC
    Tried it as well:
    # Debian and CentOS Linux: perl -e 'system("which ls");' /bin/ls
    Only on windows it did not work, since i use cygwin to perform most linux like functions...
    U:\>perl -e 'system("which ls");' /usr/bin/ls U:\>/bin/ls The system cannot find the path specified. U:\>
    What os are you using?
    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.

Log In?
Username:
Password:

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

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

    No recent polls found

    Notices?