Would you be able to help me with this script? I am learning how to create scripts in bash. It should be working but somehow it is not.
#!/bin/bash
echo "Please enter your name: "
read name
if ["$name"="Marek"]
then
echo -e "Hello Marek!\n"
else
echo "Sorry not you"
fi
Output:
mhudak@nelke:~/practice_before_Exam> ./script2.sh
Please enter your name:
Marek
./script2.sh: line 4: [Marek=Marek]: command not found
Sorry not you
SUSE Linux Enterprise Server 11 (i586)
VERSION = 11
PATCHLEVEL = 1
if
statement:if [ "$name"="Marek" ]
– eblock Oct 18 '19 at 07:33