in reply to Re: Re: parsing arguments
in thread parsing arguments
Try this
under different shells and you may get slightly different results. It's really interesting to see the difference under windows/DOS command.com or cmd.exe shells, because the asterisk at the end of the line is just taken as a literal asterisk, whereas under unix shells, the asterisk will, instead, be replaced by the list of all files and directories matching the wildcard. In DOS/windows, programs that might operate on many files interpret the asterisk themselves, whereas in unix, the asterisk is transformed by the shell. For a really simple comparison, just try:perl -MData::Dumper -e "print Dumper(\@ARGV).qq{\n}" a b c 'a b c' a\ +b\ c "a b c" "'a b c'" *
on both systems.echo *
Anyways, for really detailed information on how your various shells parse the command line into argv, you should read that shell's documentation (man page).
|
|---|