Addition in bash
Florian Diesch
diesch at spamfence.net
Fri Oct 16 07:14:12 UTC 2009
"David N. Lombard" <dnl at speakeasy.net> writes:
> Florian Diesch wrote:
>> "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
>
> http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
,----
| 2.4 Reserved Words
| [...]
| The following words may be recognized as reserved words on some
| implementations (when none of the characters are quoted), causing
| unspecified results:
|
| [[ ]] function select
|
`----
Florian
--
<http://www.florian-diesch.de/software/pdfrecycle/>
More information about the ubuntu-users
mailing list