I am new to shell scripting.
I tried to run a simple shell script using Cygwin terminal in Win XP env.
The script I have written is as follows -
#!/bin/bash
a=5
[[ "$a"== "5" ]] && echo "true" || echo "false"
But when I execute the script, getting some confusing error. The error I am getting are -
first_prog.sh: line 2: $'\r': command not found
first_prog.sh: line 4: $'\r': command not found
first_prog.sh: line 5: conditional binary operator expected
first_prog.sh: line 5: syntax error near `"5"'
first_prog.sh: line 5: `[[ "$a"== "5" ]] && echo "true" || echo "false"'
Though the commands are working fine individually when run from terminal, but not in the shell script. Do I need any settings in the Cygwin terminal?
I am using the BASH shell.
Please suggests.
Thanks in advance.