This is a very weird problem. I run test.sh using sh test.sh
but it returns an error as mentioned in the subject line.
Here's the code for reference:
#!/bin/bash
foreach n ( 1 2 3 4 5 )
echo $n
end
It's just a simple loop but it won't execute. Complete error below:
test.sh: 3: test.sh: Syntax error: "(" unexpected