programme is ok but not working in script

hi buddies;

i have a very strange problem. i made a script composed of just 5 line. it is containing awk and nawk codes and it is working perfectly when it is applied one-by-one (copy & paste).
but when i type run myscript.mos , it is giving:

nawk: syntax error at source line 1
context is
bla bla bla...

error??? :confused::eek:
how can this strange situation happen in such a strange manner??

note: i'm on Solaris .

can you copy and paste the script's contents here? It makes helping you much easier when we can see where your mistake might be

lol the "blah blah blah" might be the most important part fyi, so always include WHAT you're trying to do, AND the EXACT error message

ok. this is my code:

1> l nawk 'NR==FNR{a=a?a"get . "$0";":"get . "$0";";next;}{print "l ./moshell "$0" "c"lt all;l+;" a "l-;l cat $logfile >>
 /home/gc_sw/log.txt;l rm $logfile"c}' c="'" /home/gc_sw/params.txt /home/gc_sw/ip.txt > /home/gc_sw/command.mos
2> run /home/gc_sw/command.mos
3> l awk ' $2 ~ /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ {print "\n" $2 }  NF == 3 && $1 ~ /^.*=.*$/ {print $0 }' 
/home/gc_sw/log.txt > /home/gc_sw/1.txt
4> l nawk '/^[0-9]/&&p!=$1{printf "\n%s",p=$1} NF>1{$1=$1;sub($1" "$2" ","\t"$1"\t"$2"\t");print}' 
/home/gc_sw/1.txt > /home/gc_sw/sitedata.xls
5> l rm /home/gc_sw/command.mos /home/gc_sw/log.txt  /home/gc_sw/1.txt
1st line: process params.txt and ip.txt and write result (write "l. /moshell ...") to command.mos
2nd line: run command.mos
3rd line: text formatting
4th line: text formatting
5th line: remove unnecessary files

when i try to run this script, error is:

192.168.1.1> run get.mos //i have typed this and script is starting

192.168.1.1> l nawk 'NR==FNR{a=a?a"get . "$0";":"get . "$0";";next;}{print "l ./moshell "$0" "c"lt all;l+;" a "l-;l cat $logfile >> /home/gc_sw/log.txt;l rm $logfile"c}' 
c="'" /home/gc_sw/params.txt /home/gc_sw/ip.txt > /home/gc_sw/command.mos

nawk: syntax error at source line 1
 context is
        NR==FNR{a=a?a"get . "run >>>  get. <<< mos ";":"get . "run get.mos ";";next;}{print "l ./moshell "run get.mos " "c"lt all;l+;" a "l-;l cat
 $logfile >> /home/gc_sw/log.txt;l rm $logfile"c}
nawk: illegal statement at source line 1

192.168.1.1> run /home/gc_sw/command.mos

192.168.1.1> l awk ' $2 ~ /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ {print "\n" $2 }  NF == 3 && $1 ~ /^.*=.*$/ {print $0 }' /home/gc_sw/log.txt > /home/gc_sw/1.txt

awk: can't open /home/gc_sw/log.txt

192.168.1.1 l nawk '/^[0-9]/&&p!=$1{printf "\n%s",p=$1} NF>1{$1=$1;sub($1" "$2" ","\t"$1"\t"$2"\t");print}' /home/gc_sw/1.txt > /home/gc_sw/sitedata.xls

192.168.1.1> l rm /home/gc_sw/command.mos /home/gc_sw/log.txt  /home/gc_sw/1.txt /home/gc_sw/log.txt: No such file or directory

192.168.1.1> waiting for command

1st line of command is running with error!

Questions:

What is "run" ?
What is "l" ?      (It's usually an alias for "ls").

What Operating System version?
What Shell?

uname -a
echo $SHELL

i am using MOshell interface being started from a Unix Terminal.

run : a moshell command to execute .mos file.
l : at moshell session, type "l" and then write unix commands. it is something like "opening a unix channel"

my OS is: Solaris

> uname -a
SunOS uas 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V440

> echo $shell
/usr/bin/tcsh

As I neither use "tcsh" or "MOshell" its time to back off. In reading about MOshell I did notice that people escape underscore characters in external commands for some reason \_ .

What you are attempting looks complex and the mixture of syntax is difficult to follow. Any way you can get the external commands into unix scripts?