#!/bin/sh
read name
if test "$name"=akash
then
echo "Hello how are you"
else
echo "sorry"
This is my script but at both case I am getting "Hello how are you" response
#!/bin/sh
read name
if test "$name"=akash
then
echo "Hello how are you"
else
echo "sorry"
This is my script but at both case I am getting "Hello how are you" response
You are testing if the single string "$name"=akash
is empty or not. You need spaces around the =
so that test
sees three separate arguments.
if test "$name" = akash
then