How do you assign the value of a parameter to a variable in UNIX?
- by codeninja
#!/bin/bash
if [ ! $1 ]
then
echo "no param"
else
set FAV_COLOR=$1
echo "My fav color is ${FAV_COLOR}"
fi
This is not working how i expected:
>favcol.sh blue
My fav color is FAV_COLOR=blue
any thoughts?