i'm confused about the $symbol for unix. according to the definition, it states that it is the value stored by the variable following it. i'm not following the definition - could you please give me an example of how it is being used?
You define a variable like this:
and use like this:
If you use
EDIT: If you want to assign a string containing spaces, you have to quote it either using double quotes (") or single quotes ('). Variables inside double quotes will be expanded whereas in single quotes they won't:
In case of shell sctipts. When you assign a value to a variable you does not need to use $ simbol. Only if you want to acces the value of that variable. Examples:
The other thing: if you use assignment , does not leave spaces before and after the = simbol.
Here is a good bash tutorial: http://linuxconfig.org/Bash_scripting_Tutorial
finger: prints all logged in user example result:
grep: filter lines what containing the given string (in this example we need to filter xuser if our loginname is xuser) http://www.gnu.org/software/grep/manual/grep.html
whoami: prints my loginname http://linux.about.com/library/cmd/blcmdl1_whoami.htm
tail -n 1 : shows only the last line of results http://unixhelp.ed.ac.uk/CGI/man-cgi?tail
the awk script: prints the second and third column of the result: Forname, Nickname http://www.staff.science.uu.nl/~oostr102/docs/nawk/nawk_toc.html