ash: braceless function definiton

Denys Vlasenko vda.linux at googlemail.com
Fri Sep 24 21:36:21 UTC 2010


On Friday 24 September 2010 21:21, Mikhail Gusarov wrote:
> The following script:
> 
> ----------------------------------------
> #!/bin/sh
> 
> foo()
> exit 1
> ----------------------------------------
> 
> exits with code 0,

..."when run under ash from busybox version X.Y.Z with the attached .config",
right?

> as lines 3-4 define function foo, despite missing 
> braces around 'exit 1'. Is is proper behaviour? SUSv3 grammar requires
> compound statement as a body of function.
> 
> For the record: zsh and dash behave as ash, bash gives syntax error.

hush also gives syntax error.

This bug does not seem to be worth fixing.
-- 
vda


More information about the busybox mailing list