let me show here what i am doing:
this is the code i am running
filename: nscript
#
echo "-------------------------------"
awk '{for(i=1;i<=NF;i++)printf("%s=%s\n",$i,$i)}' script_name.txt > script_name.var && . script_name.var
###########################################################
echo "a1 is ---> $a1"
#a1 = $2
echo $a2
###########################################################
in command prompt when i type
$ bash ./nscript
i get following output
-------------------------------
a1 is ---> a1
a2
but when i type
$ csh ./nscript
I get following output
-------------------------------
/bin/.: Permission denied.
a1: Undefined variable.
since i am new to unix, am not able to understand why I am getting such error.
I googled and came across a pdf telling dot operator is not supported in csh/tcsh.
The problem, i think is that we have a code which is interpreted ok with bash, but not in csh.
---------- Post updated at 01:46 PM ---------- Previous update was at 01:37 PM ----------
also if i run the nscript with following changes
awk '{for(i=1;i<=NF;i++)printf("%s=%s\n",$i,$i)}' script_name.txt > script_name.var && source script_name.var
i get the following results
-------------------------------
script_B_1=script_B_1: Command not found.
a1=a1: Command not found.
script_B_2=script_B_2: Command not found.
a2=a2: Command not found.
b2=b2: Command not found.
script_B_3=script_B_3: Command not found.
a3=a3: Command not found.
b3=b3: Command not found.
c3=c3: Command not found.
a1: Undefined variable.
---------- Post updated at 01:55 PM ---------- Previous update was at 01:46 PM ----------
hey.. its working, with following modifications :p:p:p
awk '{for(i=1;i<=NF;i++)printf("set %s=%s\n",$i,$i)}' script_name.txt > script_name.var && source script_name.var