It is important to know the meaning of different quotation characters in c shell.
single quotes: ' turn off special meaning of all characters until
the next single quote is found.
Example: echo $PATH echo '$PATH' echo Hey, what's next? Mike's #1 friend has $value.
(output:
Hey, whats next? Mikes )
Everything after # is ignored, since # starts comment in shell
double quotes: '' work almost like single quotes,
but double quoting allows the char
$ (dollar sign),
`(back-quote),
(backslash)
to keep their special meaning.
Example:
echo "Hey, what's next? Mike's #1 friend has $value."
pair of back-quotes: ` does command substitution
Example:
How to send an e-mail message to all the users logged on to the system.
First use the command
who cut -c1-8
which will list all users currently log in.
who cut -c1-8 sort -u
will sort them in alphabetical order and will only display unique names
mail ` who cut -c1-8 sort -u`
will send e-mail to all of them.
If you are not sure, how this command works
(or you really do not want to send an e-mail to everybody)
replace mail command with echo command: