Hi ,
I am new to shell scripting.
below is my requirement :
1) while running my .sh i will pass a string
2) i have to extract a folder name under a /config folder
3) i need to compare a input string in the folder name list
4) if that is true i have to continue my job else i have to give the message to the user
here is my code :
if [ $# -ne 1 ]; then
echo "Invalid arguments!"
echo ""
echo "job Name: $(basename $0) "
echo " Please pass the environment variable "
return 1
else
env_name="$1"
fi
LIST="`ls -ltr conf/ | grep -v "total" | grep -v "pre_swh" | awk '{ print $NF "," }'`";
if ["$env_name" in "$LIST"]
then
echo "correct"
else
echo "incorrect"
fi
counter1=`expr $counter1 + 1`
#done
while running this am gettin the error
sample2.sh[25]: [test: not found.
Please anyone help me on this