Intro
I am trying to run the simplest of bash scripts on Ubuntu through WSL by calling WSL from PowerShell, passing the script as a parameter to the WSL command. My command for running WSL with the bash script is as follows
wsl ./helloworld.sh
The script helloworld.sh
contains a very simple Hello World function, along with a call to that function to perform the functions actions
#!/bin/sh
Hello() {
echo "Hello World!"
}
Hello
WSL is launched and the script is ran (at least I am pretty sure) however I get an error result
./<path_to_file>/helloworld.sh: 5: Syntax error: end of file unexpected (expecting "}")
Question
Is there some important knowledge that I am missing about Linux/Ubuntu and functions or how the Bash Shell executes the file line by line? I have been reading multiple Linux tutorials and guides (Bash Functions , Shell Script Functions , and More Bash Script Functions) as I am extremely new to Linux and would like to expand my knowledge, however from what I can tell all of these guides would lead me to believe that my script above should work. What is causing this script to not execute how I would like? (Echoing"Hello World!" to the console) I attached below an image of what a "working script" looks like from one of the guides I referenced if it helps.
Note: If this belongs in a different community, please let me know!