line PWD="'pwd'" sets PWD to string pwd
but working PWD=$PWD
PWD="'pwd'" is not what I wrote, that should be "`pwd`"
ie: not single quotes, but the other one (sorry, don't know the english name).
- man bash (might be a bit cryptic at times)
(Linux Shell Scripting Tutorial)
- any book about bash/ksh.
The variable name you choose is free (well, almost. There are some reserved names).
If you want to fill a variable with a certain value:
variablename=value (variable on the left and value on the right)
So WD="foo" will assign foo to the variable WD.
The PWD="`pwd`" (or WD="`pwd`") is a bit more complicated.
The PWD (or WD) part is the name of the variable, nothing strange here.
pwd is a command, so WD="`pwd`" will be interpreted as follows (command line processing):
1) pwd will be executed,
2) `pwd` will be substituted by the result of 1
3) WD will be filled with result of 2
Hope this helps a bit.