Package: posh
Version: 0.8.4
Severity: normal

$ posh -c 'f() echo test; f'
test

Same output for all the other Bourne-like shells but bash.

$ bash -c 'f() echo test; f'
bash: -c: line 0: syntax error near unexpected token `echo'
bash: -c: line 0: `f() echo test; f'

which makes that construct non-portable even it it's Bourne. So
posh should return an error as well. POSIX requires a compound
command for the function body, so the behavior is unspecified if
a simple command is used instead. From SUSv4:

 function_definition : fname '(' ')' linebreak function_body
                  ;
 function_body    : compound_command                /* Apply rule 9 */
                  | compound_command redirect_list  /* Apply rule 9 */

f() (echo test)
f() { echo test;}
f() for i in .; do echo test; done

are allowed, but not:

f() echo test


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (50, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-2-686 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_US.ISO-8859-15 (charmap=UTF-8) (ignored: 
LC_ALL set to en_GB.UTF-8)
(interstingly, without the LC_ALL, reportbug crashed)
Shell: /bin/sh linked to /bin/bash

Versions of packages posh depends on:
ii  debconf [debconf-2.0]         1.5.28     Debian configuration management sy
ii  libc6                         2.10.1-1   GNU C Library: Shared libraries

posh recommends no packages.

posh suggests no packages.

-- debconf-show failed



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to