You are viewing a single comment's thread. Return to all comments →
It needs space before and after the equal to sign. A single equal to sign will do.
x="" read x if [[ x = 'y' ]]; then echo "YES" elif [[ x = 'n' ]]; then echo "NO" fi exit 0
Seems like cookies are disabled on this browser, please enable them to open this website
Getting started with conditionals
You are viewing a single comment's thread. Return to all comments →
It needs space before and after the equal to sign. A single equal to sign will do.
!/bin/bash
x="" read x if [[ x = 'y' ]]; then echo "YES" elif [[ x = 'n' ]]; then echo "NO" fi exit 0