A script is those commands in a file, with a name

On Windows you must be in WSL Ubuntu or Git Bash. Never PowerShell, never CMD.

Line one is the shebang: #! and then an interpreter. It is not a comment — the kernel reads those two bytes and hands the file to whichever program follows. env bash finds whichever bash is on your PATH. Then chmod +x, and run it as ./logsum.sh.

cat > logsum.sh <<'EOF'
#!/usr/bin/env bash
echo "reading app.log"
wc -l app.log
EOF
chmod +x logsum.sh
./logsum.sh
reading app.log
    5000 app.log
You do

Get the log file. Nobody types the script yet — watch me build that.

mkdir -p /tmp/lab && cd /tmp/lab
[ -s app.log ] || curl -fsS -o app.log http://localhost:8899/files/app-2026-08-01.log \
  || cp /Volumes/DATAEKO/app-2026-08-01.log app.log 2>/dev/null \
  || cp "/media/$USER/DATAEKO/app-2026-08-01.log" app.log 2>/dev/null \
  || cp /mnt/e/app-2026-08-01.log app.log 2>/dev/null \
  || echo "take app-2026-08-01.log off the USB stick — save it here as app.log"
ls -l app.log
1/31 exit