I must be missing something here because no matter what bash compiler I use online and no matter what bash script I write I get the same Unexpected end of file
error.
Here's my script
function hello { echo 'hello' } hello
I've also tried this
#!/bin/bash
hello_world () {
echo 'hello, world'
}
jdoodle.sh: line 2: $'\r': command not found jdoodle.sh: line 3: syntax error near unexpected token `$'{\r'' jdoodle.sh: line 3: `hello_world () { '
And this
#!/bin/bash
f() { $branchName = "branch" echo $branchName}; f
hello_world
I'm using this tool:
https://www.jdoodle.com/test-bash-shell-script-online/
Why can't I write a simple bash script?