You should use #!/usr/bin/env bash
for portability: different *nixes put bash
in different places, and using /usr/bin/env
is a workaround to run the first bash
found on the PATH
. And sh
is not bash
.
More Related Contents:
- Should I use a Shebang with Bash scripts?
- Why is #!/usr/bin/env bash superior to #!/bin/bash?
- Expansion of variables inside single quotes in a command in Bash
- What is the cleanest way to ssh and run multiple commands in Bash?
- How can I do a recursive find/replace of a string with awk or sed?
- How to add a progress bar to a shell script?
- How can I write a heredoc to a file in Bash script?
- What is the purpose of “&&” in a shell command?
- How do I use floating-point arithmetic in bash?
- Extract data from log file in specified range of time [duplicate]
- Bash script and /bin/bash^M: bad interpreter: No such file or directory [duplicate]
- How to get the primary IP address of the local machine on Linux and OS X? [closed]
- How to suppress Terminated message after killing in bash?
- Setting an environment variable before a command in Bash is not working for the second command in a pipe
- Delete all lines beginning with a # from a file
- Copy folder recursively, excluding some folders
- Getting the parent of a directory in Bash
- How to loop through dates using Bash?
- Building R Packages using Alternate GCC
- Bash script – “/bin/bash^M: bad interpreter: No such file or directory” [duplicate]
- Running programs in parallel using xargs
- find -exec with multiple commands
- What is the best way to count “find” results?
- How do I check if a directory exists or not in a Bash shell script?
- bash “if [ false ];” returns true instead of false — why?
- Using conditional statements inside ‘expect’
- shell script respond to keypress
- Multi Level Bash Completion
- Left side of pipe is the subshell?
- How to read variables from file, with multiple variables per line?