Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: tar, system() & pipes?

by Anonymous Monk
on Jul 17, 2007 at 20:55 UTC ( #627127=note: print w/replies, xml ) Need Help??


in reply to Re^3: tar, system() & pipes?
in thread tar, system() & pipes?

Thank you! Use of quotemeta appears to work.

Why is this needed?

Replies are listed 'Best First'.
Re^5: tar, system() & pipes?
by Argel (Prior) on Jul 17, 2007 at 22:11 UTC
    Why is quotemeta needed or why do you have to call 'system' this way? For quotemeta the code will work for files with special characters in them. For system I imagine the LIST version exists to make it easier to pass in a large number of parameters, deal with ones with special characters, and/or build a list of parameters without having to join them later on. As explained by others the IO redirection ('>') is something the shell handles but when system is called in LIST context it will be passed to the tar command as a parameter instead. Because tar has no '>' command line option it errors out -- just like it does with any other incorrect parameter (e.g. -y).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2023-03-26 03:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (63 votes). Check out past polls.

    Notices?