How to list functions?
Hi,
posh has support for functions.
$ f() { echo foo; }
$ f
foo
$ Unfortunately I am unable to list the defined functions.
I tried typeset, declare and set without success in posh 0.10.2 on Debain Wheezy.
Any hints very welcome.
Thanks in advance.
Kind regards,
-Alex
Quoted 3 lines · Alexander Huemer
Hi,
posh has support for functions.
Wrong list. posh is a different shell than dash, so there's nothing this list can do to change posh.
Quoted 8 lines
$ f() { echo foo; } $ f foo $Unfortunately I am unable to list the defined functions.
I triedtypeset,declareandsetwithout success in posh 0.10.2 on
posh tries hard to limit itself to POSIX (which does not yet define 'typeset', lacks 'declare', and where 'set' does not list function bodies). As far as I can see, POSIX doesn't require shells to be able to output function bodies. For posh to provide this, they'd have to give you an extension beyond POSIX; but that goes against the goals of posh. Sorry.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 3 lines · Alexander Huemer
Hi,
posh has support for functions.
Wrong list. posh is a different shell than dash, so there's nothing this list can do to change posh.
Quoted 8 lines
$ f() { echo foo; } $ f foo $Unfortunately I am unable to list the defined functions.
I triedtypeset,declareandsetwithout success in posh 0.10.2 on
posh tries hard to limit itself to POSIX (harder than dash), and POSIX does not yet define 'typeset', lacks 'declare', and does not require 'set' to list function bodies. Thus, as far as I can see, POSIX doesn't require shells to be able to output function bodies. For posh to provide this, they'd have to give you an extension beyond POSIX; but that goes against the goals of posh. Sorry.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org