A great number of people write bash scripts for Linux.
Most of these scripts start with
bash is not installed on FreeBSD by default.
When installed, it is installed in /usr/local/bin/bash.
This post covers a few strategies for using scripts that start with
#!/bin/bash on FreeBSD.
I used one of these strategies in a previous post.
First, bash needs to be installed.
The simplest option is to create a symlink from /usr/local/bin/bash to /bin/bash.
At this point, the following script should work without modification.
If you object to adding a symlink, the following command can be used to
#!/bin/bash with the more portable
If a large number of files need to be changed, the following can be used to recursively patch all files in a directory.