i want to write if statment as following :-
if [$x == "string"]
then
echo "ok"
fi
but the following error appear
./bash_if.sh[6]: [0: not found.
|
i want to write
but the following error appear
| |||
feedback
|
|
Also, if you are testing strings, you should put quotes around $x:
Otherwise, if $x is empty or unset, you will get an error because without the quotes, after "expanding" $x, it will look like
| |||
|
feedback
|