csh script variables setting
Hi All,
I wrote a csh (C-shell) script name "myscript" that only does setting of variables and nothing else.
--------------------------------------------------
#!/usr/bin/csh -f
set group = "mike mary jack jane"
echo $speak
-------------------------------------------------
After changing mode (% chmod 744 myscript) and included the path of the script "/home/me/bin" to my PATH enviroment variables. I did a rehash (% rehash) and assured that my "/home/me/bin" is in the command path. I ran the script "% myscript" and returned with "hello world". This is OK.
% myscript
mike mary jack jane
The problem is it doesn't set the variable "speak" in my current shell.
% echo $speak
speak : Undefined variables.
It seems that the variable "group" has been set during the script but somewhat out of scope after leaving the script. Tried finding script books on variable setting but nothing on scopes. Or have i left out a command after setting? Appreciate if someone can help.....
|