On Thu, 2002-03-28 at 10:20, Hartono, Susanto wrote: [...snipped...] > localhost$ script-name arg1 "arg2 `rm -rf /*`" > > How do I simply extract arg2 without executing the illegal instructions? > > I know how to do this in Perl but not in Bourne shell script.
For the above, the part in the single forward(?) quotes will be executed by the shell and the result passed into the script as part of the scripts command-line. So there is no way your script can prevent the rm command being executed. I thought it was possible to turn off command expansion, but a quick skim of the docs didn't seem to suggest it was. Cheers, Malcolm V.
signature.asc
Description: This is a digitally signed message part
