dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to list functions?
@ 2013-10-22 12:05 Alexander Huemer
  2013-10-22 13:50 ` Eric Blake
  2013-10-22 13:56 ` Eric Blake
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Huemer @ 2013-10-22 12:05 UTC (permalink / raw)
  To: dash

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to list functions?
  2013-10-22 12:05 How to list functions? Alexander Huemer
@ 2013-10-22 13:50 ` Eric Blake
  2013-10-22 13:56 ` Eric Blake
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2013-10-22 13:50 UTC (permalink / raw)
  To: Alexander Huemer, dash

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

On 10/22/2013 01:05 PM, Alexander Huemer wrote:
> 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.

> 
> $ 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 

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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to list functions?
  2013-10-22 12:05 How to list functions? Alexander Huemer
  2013-10-22 13:50 ` Eric Blake
@ 2013-10-22 13:56 ` Eric Blake
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2013-10-22 13:56 UTC (permalink / raw)
  To: Alexander Huemer, dash

[-- Attachment #1: Type: text/plain, Size: 870 bytes --]

On 10/22/2013 01:05 PM, Alexander Huemer wrote:
> 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.

> 
> $ 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 

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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-22 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-22 12:05 How to list functions? Alexander Huemer
2013-10-22 13:50 ` Eric Blake
2013-10-22 13:56 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).