root /etc/csh

Polytropon freebsd at edvax.de
Tue Nov 11 23:06:19 PST 2008


On Tue, 11 Nov 2008 10:13:02 -0500, Jerry McAllister <jerrymc at msu.edu> wrote:
> Probably is the main reason, though another is that some things
> may be written assuming a particular shell.  Not a good practice,
> but happens.

Especially in Linux, it's common to prefix scripts with #!/bin/bash
which won't work in FreeBSD, because it's #/usr/local/bin/bash there.
Linux has no problem running #!/bin/sh scripts because there's a
symlink /bin/sh -> /bin/bash.

My advice for maximum interoperability and compatibility between Linux
and UNIX: If you're not using any bash specific techniques in your
scripts, start them with #!/bin/sh instead of #!/bin/bash.

The sh shell is the UNIX standard scripting shell, while Linux's
one is bash.


-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list