Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Executing external program via backquotes

by 5mi11er (Deacon)
on Feb 10, 2010 at 22:09 UTC ( #822532=note: print w/ replies, xml ) Need Help??


in reply to Executing external program via backquotes

Well, you're already surrounding the directory you're searching through with double quotes, now try surrounding the $_ argument with double quotes too:

@results = `grep -i "$_" $can_archive`;
-Scott


Comment on Re: Executing external program via backquotes
Download Code
Re^2: Executing external program via backquotes
by King0 (Initiate) on Feb 10, 2010 at 22:35 UTC

    Thanks for the suggestion; I had that in my first version of the script -- but unfortunately double quoting $_ doesn't resolve the issue. Rather, when the argument is supplied to grep it some how breaks the argument into to separate ones, in spite of the variable being double quoted. For example, if the $_ variable held Jon Doe -- the error would be:

    grep Jon: No such file or directory grep Doe: No such file or directory
    Do you have any other suggestions? Thanks. -Dan

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-12-25 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (160 votes), past polls