The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

perl problem. by colonele2002-06-07 09:12:11
  system() by SMcV 2002-06-07 09:41:53
system($scalar) uses /bin/sh to interpret the command $scalar. What you want is:

# get the command and args into @array somehow
# for example, for "ls -al --color '/home/me/some directory'"
# you want something like:
@array = ( 'ls', '-al', '--color', '/home/me/some directory' );
# then run ls, passing ls as its name and the rest as its args
system { $array[0] } @array;

This means the system command actually has ls in it twice - that's not a bug, it lets you do things like

system { 'bash' } ( '/bin/sh' );

to make bash think it was invoked as /bin/sh.
[ Reply ]

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)