#!/bin/bash
string=$1
if [ $string=red ]; then
echo "blue"
elif [ $string=blue ]; then
echo "red"
else
echo "nocolour"
fi
in the above script if I run
red script.sh
i am getting blue
if I run
blue script.sh
it is showing the following error
File "script.sh", line 2
string=$1
^
SyntaxError: invalid syntax
pls solve my problem
if i run blue script.sh i have to get red
if i run something script.sh i have to get noclour