nillo
11-07-2002, 11:41 PM
i try to run a script i wrote and get the following:
$ mygrep2 un322
mygrep2[3]: un322:lqPPBjOWp6inA:284:80:jacob: bad number
un322:lqPPBjOWp6inA:284:80:jacob
mygrep2[3]: larsen:/home/unix3/un322:/bin/ksh: bad number
larsen:/home/unix3/un322:/bin/ksh
mygrep2[7]: shift: bad number
the contents of the script are as follows:
$ cat mygrep2
for file in `grep $1 /etc/passwd`
do
if [ $file -eq 0 ]
then echo $1" was not found in /etc/passwd"
else echo $file
fi
shift
done
im havin a bit o trouble with for statements
help pleasE?
much thanx ;)
$ mygrep2 un322
mygrep2[3]: un322:lqPPBjOWp6inA:284:80:jacob: bad number
un322:lqPPBjOWp6inA:284:80:jacob
mygrep2[3]: larsen:/home/unix3/un322:/bin/ksh: bad number
larsen:/home/unix3/un322:/bin/ksh
mygrep2[7]: shift: bad number
the contents of the script are as follows:
$ cat mygrep2
for file in `grep $1 /etc/passwd`
do
if [ $file -eq 0 ]
then echo $1" was not found in /etc/passwd"
else echo $file
fi
shift
done
im havin a bit o trouble with for statements
help pleasE?
much thanx ;)