[TriLUG] bash cmd line processing question
Paul D. Boyle
boyle at laue.chem.ncsu.edu
Thu Feb 14 13:36:50 EST 2002
Mike Mueller wrote:
>
> why does the following command work:
>
> $kill -SIGHUP `cat /var/run/syslogd.pid`
>
> why does the following command *not* work:
>
> $kill -SIGHUP 'cat /var/run/syslogd.pid'
Beacuse the backquotes (`) cause command substitution, i.e. the
shell substitutes the command (and the backquotes) with the
output produced by that command.
The (') is one of the ways to quote strings in shells, and I have
never really understood the difference between " and '.
Paul
--
Paul D. Boyle | boyle at laue.chem.ncsu.edu
Director, X-ray Structural Facility | phone: (919) 515-7362
Department of Chemistry - Box 8204 | FAX: (919) 515-5079
North Carolina State University |
Raleigh, NC, 27695-8204
http://laue.chem.ncsu.edu/web/xray.welcome.html
More information about the TriLUG
mailing list