शब्दकोश · ऑपरेटिंग सिस्टम और सॉफ़्टवेयर

Bash

Bash is the default shell on most Linux systems, a command interpreter and scripting language descended from the original Unix Bourne shell.

अपडेट: अक्टूबर 6, 2026

Bash (Bourne Again SHell) is a Unix shell and scripting language created for the GNU project. It runs interactive commands and executes script files, and it is the default shell on many Linux distributions.

Why it matters

Bash scripts automate deployments, log rotation, backups, and health checks, and a cron job often calls one. Learning a few features, such as pipes, redirection, variables, and exit codes, covers most daily work.

A script reports success with exit code 0 and failure with any other value, which is how monitoring tools decide whether a job worked.

Example

#!/usr/bin/env bash
set -euo pipefail
if curl -fsS https://example.com > /dev/null; then
  echo "site up"
else
  echo "site down"
fi

set -euo pipefail makes the script stop on errors and unset variables.

Common mistakes

  • Skipping set -e so a failed step is ignored and the script keeps going.
  • Leaving variables unquoted, which breaks on spaces and wildcards.
  • Using bash-only syntax in a script that starts with #!/bin/sh.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.