Batch and Bash are two OGs in the shell scripting world. Both let you automate tasks and run commands, but they're built for totally different ecosystems.
Batch scripts run on Windows using the Command Prompt (CMD). Theyβre simple but kinda limited, mostly for quick automation in Windows environments.
@echo off echo Hello from Batch! set /p name=Enter your name: echo Hello, %name%! pause
.bat
or .cmd
Bash (Bourne Again Shell) is the king of Unix-like OS scripting β Linux, macOS, and many servers run it by default. It's way more powerful and flexible than Batch.
#!/bin/bash echo "Hello from Bash!" read -p "Enter your name: " name echo "Hello, $name!" read -n1 -r -p "Press any key to continue..." key
.sh
, usually executable