help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] which file in bash source code (tarball) contain a print


From: Eric Blake
Subject: Re: [Help-bash] which file in bash source code (tarball) contain a print output function
Date: Tue, 20 Mar 2012 21:03:29 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

On 03/20/2012 06:07 PM, Bob Proulx wrote:
> Eric Blake wrote:
>> 'function' is a bashism; I would recommend sticking to the POSIX syntax of:
> 
> Don't you mean ksh'ism?  :-)

I suppose.  But I tend to generically use the term 'bashism' for any
feature of bash not required by POSIX, and therefore not portable to
other POSIX shells like dash.

> 
> It is ksh syntax that bash has as a compatibility extension.

Except that ksh and bash differ on semantics; in ksh, you get different
scoping rules depending on whether you used 'function' or '()' to
declare a function, whereas bash uses dynamic scoping for both forms.
So using 'function' in bash does not always give the same results as
ksh, and thus the term 'bashism' might be apropos to this particular
extension.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]