dash doesn't understand the function keyword

Bug #82468 reported by era
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dash (Ubuntu)
Invalid
Undecided
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.

Revision history for this message
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.

-Forest

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.