Hello everybody, I have a problem with creating a script which allows a single parameter to be passed. Sorry if I'm not expert, I'm new at this and .
The code is
if [ "$1" = "" ]; then
echo "Something"
exit
fi
...does other things...
grep -i $1 $TEMPUSERS > $USERSFILE
COUNT=`wc -l $USERSFILE`
echo "Found $COUNT users"
There are two errors:
1) the grep $1 is not correctly interpreted because the expanded command doesn't have the ' delimitator.
2) There must be some error on the COUNT assignment too, because it doesn't write out the no of lines in the file.
I tried with ksh and bash shell, but it doesn't seem to be a shell type problem.
I know i'm really at the basics, but some help would be very appreciated