Addition in bash

Florian Diesch diesch at spamfence.net
Wed Oct 14 18:22:45 UTC 2009


James Michael Fultz <croooow at gmail.com> writes:

> * David N. Lombard <dnl at speakeasy.net> [2009-10-14 06:23 -0700]:
>> Ray Parrish wrote:
>> >> #!/usr/bin/env bash
>> 
>> #!/bin/bash
>> 
>> env is used when you don't know the absolute path of the binary.  bash 
>> is /bin/bash--to move it elsewhere would cause intense carnage.
>
> Generally a safe assumption on GNU/Linux, but not so on other Unix-like
> platforms.  It could be '/usr/pkg/bin/bash' on NetBSD, or
> '/usr/local/bin/bash' on FreeBSD or Solaris, etc.

If you want a script to run on other platforms you should try to use
POSIX /bin/sh instead of bash.


   Florian
-- 
<http://www.florian-diesch.de/software/shell-scripts/>




More information about the ubuntu-users mailing list