Where can I find a beginner-friendly Git Bash command manual?

Hello everyone,

I have just connected my Git Bash terminal to Visual Studio to run my javascript functions. However, I have no idea what command/prompt is correct i need to type in in order to run each function here in Bash.

I went completely by my intution and typed "printf ‘startGame’ but instead of the word “Started” that I need to see i only got the repetition of ‘startGame’ as the result, which is not the word I wanted. The original function is written below.

Google hasn’t helped me so far. I have not found any manual specific to Bash. Where can I find a beginner friendly Git bash command guide to run my functions? I feel like i used the wrong word to run it.

Here is the function I am trying to run in Bash:

function startGame() {
return(console.log(‘Started’));

1 Like

printf is a shell function that prints the given text, and substitutes certain placeholders (if any) with additional arguments (if any). So printing the text you gave it is exactly the expected behavior.

Bash is a specific implementation of the Unix shell, with some extensions. Git Bash is a version of Bash bundled with the Git command line tool for Windows, AFAIK mostly to make sure users have a compatible shell available. Bash runs shell scripts, think of a single command as an extremely simple script. :wink:

You can’t (directly) run Javascript in Bash, because it’s a different language. On the Bash command line you need to call a program that knows how to run your Javascript. You mentioned Node.js in another thread, so I assume it’ll be some Node.js tool, but that’s not something I’m familiar with.

1 Like

Assuming you’re on Windows, I’d suggest installing nodejs, probably using

The package is available:
https://community.chocolatey.org/packages/nodejs

Then you can just run node in your favorite shell (PowerShell, cmd, bash, …).