sh
What is a .sh file?
application/x-sh
A shell script (.sh) is a plain-text program for a Unix shell such as bash — a sequence of commands with variables, conditionals, loops, functions, and pipelines. Scripts start with a shebang line (like #!/usr/bin/env bash) and are used for automation, builds, and system administration.
How to use a .sh file
Use an example .sh file to test syntax highlighters, shell linters (ShellCheck), formatters (shfmt), and parser or language-detection tooling. It uses LF line endings so it runs correctly on Unix.
Download example .sh files
- Shell — Hello WorldThe classic hello-world in Bash — a shebang and echo, with LF line endings so it runs on Unix — for testing highlighters, ShellCheck, and shell parsers.
- Shell — Backup script (strict mode, functions)A realistic Bash script using strict mode (set -euo pipefail), functions, default parameters, a loop, and conditionals — an illustrative fixture (review before running) for testing highlighters, ShellCheck, and shfmt.