> ---ORIGINAL MESSAGE--- > Date: Wed, 08 Jan 2003 12:13:54 -0800 > From: Matt Holland <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Re: [vox-tech] bash question > Reply-To: [EMAIL PROTECTED] > > Sorry, the example isn't quite clear... the only reason for the line > containing only '"$1";' was to demonstrate that the program that's > getting called by the script is in the path, and that the program runs. > The line before that is also quite stripped down from what I would use > in the case I'm actually interested in: > > "$1 -i$I -$2 -$3 -$4 -o$3/$J.out > /dev/null"; > > But it contained the elements that I wanted to test. Anyway, thanks, > because the problem seems to have been the quotes. I thought I needed > the quotes to force substitution of $1, $2, etc., but it seems I was wrong. >
The shells have three kinds of quotes. Double quotes " " will supress filename substitution for the * and ? characters, and whatever is between the quotes (including spaces) will be treated as a single token. Single quotes (apostrophes) ' ' will supress filename substitutions and variable substitutions and command substitutions (but for some reason in tcsh it doesn't supress history substitutions), and whatever is between the quotes (including spaces) will be treated as a single token. Backquotes ` ` are equivalent in bash to $( ), and anything between them is regarded as a command to be run, and whatever that command writes to standard output is substituted (as multiple tokens, unless the whole construct is listed in quotes). Try the following to give you a good example of what goes on: mkdir test cd test ls touch * ls touch "*" ls thouch "$USER" ls touch '$USER' ls touch `date` ls touch "`date`" ls touch '`date`' ls when you're done, use rm -i * to delete everything _______________________________________________ vox-tech mailing list [EMAIL PROTECTED] http://lists.lugod.org/mailman/listinfo/vox-tech
