Hi, i am making a little script that when its invoked with p or f, it will do different things (p will ask the user to input an string and it will count its words , and f will ask the user a directory and will list the number of files in that directory. But if wont get the comparation string right:
opcion=$1
if [ "$opcion"="p" ]
then
echo $opcion
echo "Escribe una cadena"
read cadena | wc -w
fi
if [ $opcion=f ]
it always go to the first and the second if, no matter if the option is f or p.... any ideas?