Addition in bash

Florian Diesch diesch at spamfence.net
Thu Oct 15 08:48:35 UTC 2009


"David N. Lombard" <dnl at speakeasy.net> writes:

> Florian Diesch wrote:
>> 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.
>
> Fortunately, modulo the shbang line, everything discussed so far on this 
> thread has also been POSIX and Korn compatible.

[[ ... ]] is bash-specific




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




More information about the ubuntu-users mailing list