-
Marc Deop
-
RE: script!!!
-
[code]"unset a[/code]
This is clearing the "a" variable
[code]echo " $a=$(who) "[/code]
This is echoing to the terminal the expansion of the "a" variable (which you just cleared a line above!) as well as a "=" sign followed by the output of the "who" command.
What you are trying to do is:
[code]unset a
a="$(who)"
echo "$a"[/code]
However, why don't you just do:
[code]function a { who }[/code]
-
11 Feb
"unset a
This is clearing the "a" variable
echo " $a=$(who) "
This is echoing to the terminal the expansion of the "a" variable (which you just cleared a line above!) as well as a "=" sign followed by the output of the "who" command.
What you are trying to do is:
unset a
a="$(who)"
echo "$a"
However, why don't you just do:
function a { who }