I'm trying to run a script script.sh from an Ubuntu WSL. In the Ubuntu WSL, calling sh script.sh simply returns without doing anything. Am I doing something wrong? what is the correct way to run Bash scripts in WSL?
I can run the script from Cygwin, so I know it is valid. The EOL is set to Unix. I've set permissions to 777. I've tried running it both from within the WSL interactive shell, and as a command from PowerShell: bash script.sh; neither works. I've tried bash, sh, wsl, ./.
Script:
#!/bin/bash
echo "hello"
Result from WSL:
~/test$ bash script.sh
~/test$
Result from Cygwin:
$ bash script.sh
hello
~/AppData/<path to ubuntu home>/test
$