I'm new to bash scripting and learning "if then" statements. When I run the simple script below it executes and gives me the correct result however I still get an error. The name of the script is testscript.sh. The error is as follows: "./testscript: line 5: [csh: command not found]"
Can someone tell what this means?
#! /bin/bash
MY_SHELL="csh"
If ["$MY_SHELL" = "bash"
then
echo "You seem to like the bash shell."
else
Then "You don't seem to like the bash shell."
fi
bash if
and the first link is a tutorial that should get you everything you need, in particular theString comparisons
section at the end: tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html – Dave yesterday