dash doesn't understand the function keyword

Bug #82468 reported by era on 2007-01-31
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dash (Ubuntu)
Forest Bond

Bug Description

Binary package hint: dash

Not sure if this is properly a POSIX conformance bug, but all of my shell scripts where I have used "function fnord { ... }" stopped working after I upgraded to Edgy.

Turns out dash does have functions, but it only understands the "fnord () { ... }" syntax.

Because of this, I had to change a large number of scripts, including my X session login, which wouldn't work because it bailed out with a syntax error.

I've been unable to find a definite reference on whether one or both syntaxes are properly POSIX 1003.2. For example, http://tinyurl.com/yps6vl doesn't mention a "function" keyword at all, whereas e.g. http://www.unix.org.ua/orelly/unix/ksh/appa_02.htm implies that this functionality is specified in POSIX.

Forest Bond (forest-bond) wrote :

The function keyword is a bash-ism. See http://uwsg.ucs.indiana.edu/usail/eds3shell/syntax.html; documentation on that page is Bourne-shell-specific.


Changed in dash:
status: Unconfirmed → Rejected
assignee: nobody → forest-alittletooquiet
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers