On 11/17/2011 01:11 PM, Stephane CHAZELAS wrote:
>> 4. The bash FUNCNAME variable was very valuable for debugging purposes and 
>> is nonexistent in dash
> 
> 
> If your functions are written as
> 
> f() {
>   ...
> }
> 
> sed 's/^[[:blank:]]*\([^[:blank:]]*\)[[:blank:]]*()[[:blank:]]*{/& local 
> FUNCNAME=\1;/'

Except that 'local' is not part of POSIX, so while this conversion may
work for dash, it's not a portable catch-all for other compliant shells.

-- 
Eric Blake   [email protected]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to