How to begin a $SHELL script

The program /bin/bash is one of many shells, which is a program that interprets command-line input.

#!/bin/bash

A common use of the env command is to launch interpreters, by making use of the fact that env will search $PATH for the command it is told to launch. Since the shebang line requires an absolute path to be specified, and since the location of various interpreters (perl, bash, python) may vary a lot, it is common to use:

#!/usr/bin/env python3

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Wil (₩) Moore III

Wil (₩) Moore III

Technical Writer, Software Engineer Specializing in NodeJS, TypeScript, React & React Native, SQL, DevOps, AWS, Azure, & ElasticSearch. Author of selectn.js.