in reply to Re: system, pipes, shell, quoting
in thread system, pipes, shell, quoting
$file1 = s/(\W)/\\$1/; # and similarly for other filenames
unfortunately, this doesn't seem to work. Here is an example :-(
foreach $d ( @dirs ) { -e $d or die; # works -d $d or die; # works $d =~ s/(\W)/\\$1/g; system("touch $d"); # touch can't find it, it prints an error!!! }
"open" will most likely do the same thing. The problem is the basic act of quoting arbitrary unprintable characters to the shell (nevermind security for the time being). FYI, the shell is /bin/sh on FreeBSD 4.1, which I assume is pretty solid.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: system, pipes, shell, quoting
by graff (Chancellor) on Nov 13, 2002 at 06:14 UTC | |
by superpete (Beadle) on Nov 13, 2002 at 06:48 UTC | |
by superpete (Beadle) on Nov 13, 2002 at 06:59 UTC | |
by superpete (Beadle) on Nov 13, 2002 at 06:24 UTC | |
by superpete (Beadle) on Nov 13, 2002 at 06:39 UTC | |
by graff (Chancellor) on Nov 13, 2002 at 07:22 UTC | |
by superpete (Beadle) on Nov 13, 2002 at 07:42 UTC |