Bug 32830 - Parser problem with functions
Parser problem with functions
Product: Red Hat Linux
Classification: Retired
Component: bash (Show other bugs)
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-03-23 11:42 EST by Marco Colombo
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-23 11:42:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Marco Colombo 2001-03-23 11:42:03 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.17-14 i686)

bash-2.04$ bash -c "hwhois() { fwhois $1@whois.arin.net }"
bash: -c: line 2: syntax error: unexpected end of file

it works with bash v1.14.7(1); bash 2 wants:
bash-2.04$ bash -c "hwhois() { fwhois $1@whois.arin.net; }"  (note the

If you split the function definition on more lines (with the closing
bracket on its own) it works as expected (no extra semicolon required).
This breaks some scripts here. I can't tell which one is correct, but I
believe compatibility is a issue (more than parser strict adherence to
formal grammar).

Reproducible: Always
Steps to Reproduce:
(see above)
Comment 1 Bernhard Rosenkraenzer 2001-03-25 09:04:10 EST
bash 2.x is correct - POSIX mandates this behavior.

Note You need to log in before you can comment on or make changes to this bug.