--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: pdksh: `case' inside of `$( )' command substitution gives syntax error
- From: Jeff Sheinberg <jeffsh@erols.com>
- Date: Mon, 5 Mar 2001 10:34:44 -0500 (EST)
- Message-id: <20010305153444.E66F915D38@eden-hda7.my.local>
Package: pdksh
Version: 5.2.14-3
Severity: normal
Hi,
The following typescript shows that pdksh reports a syntax error
for a `case' statement inside of the `$( )' form of command
substitution. I looked at the SUSv2 docs, and according to my
reading, this should be a legal shell construct.
Both ash and ksh93 handle this correctly, while bash and pdksh do
not. Also note that the same `case' inside of either the old
style (back-quoted) command substitution or inside of a sub-shell
`( )' _is_ handled correctly by pdksh.
Note too that if the case selector has the leading (optional) `(',
then pdksh will handle the otherwise same `case' correctly.
Here are some notes regarding the typescript,
1. !137 - pdksh gives syntax error, new style $( ).
2. !138 - ok with (2) case selector, new style $( ).
3. !139 - ok with 2) case selector, old style ` `.
4. !140 - ok with 2) case selector, sub-shell ( ).
5. !141 - ok with (2) case selector, sub-shell ( ).
Here is the typescript itself,
137 jeff ~ $ do_shells 'aa=$( case 1 in 2) ;; esac )'
========================================================================
>> aa=$( case 1 in 2) ;; esac ) <<
sh: line 1: syntax error near unexpected token `;'
sh: line 1: `aa=$( case 1 in 2) ;; esac )'
-- sh -- exit status 2
-- ash --
bash: line 1: syntax error near unexpected token `;'
bash: line 1: `aa=$( case 1 in 2) ;; esac )'
-- bash -- exit status 2
pdksh: <stdin>[1]: syntax error: `;;' unexpected
-- pdksh -- exit status 1
-- ksh93 --
138 jeff ~ $ do_shells 'aa=$( case 1 in (2) ;; esac )'
========================================================================
>> aa=$( case 1 in (2) ;; esac ) <<
-- sh --
-- ash --
-- bash --
-- pdksh --
-- ksh93 --
139 jeff ~ $ do_shells 'aa=` case 1 in 2) ;; esac `'
========================================================================
>> aa=` case 1 in 2) ;; esac ` <<
-- sh --
-- ash --
-- bash --
-- pdksh --
-- ksh93 --
140 jeff ~ $ do_shells '( case 1 in 2) ;; esac )'
========================================================================
>> ( case 1 in 2) ;; esac ) <<
-- sh --
-- ash --
-- bash --
-- pdksh --
-- ksh93 --
141 jeff ~ $ do_shells '( case 1 in (2) ;; esac )'
========================================================================
>> ( case 1 in (2) ;; esac ) <<
-- sh --
-- ash --
-- bash --
-- pdksh --
-- ksh93 --
Thanks,
--
Jeff Sheinberg <jeffsh@erols.com>
-- System Information
Debian Release: woody/testing
Kernel Version: Linux eden-hda7.my.local 2.2.18 #2 Wed Feb 7 08:10:35 EST 2001 i586 unknown
Versions of the packages pdksh depends on:
ii libc6 2.2.2-1 GNU C Library: Shared libraries and Timezone
--- End Message ---
--- Begin Message ---
- To: 88653-done@bugs.debian.org
- Subject: pdksh: �case' inside of �$( )' command substitution gives syntax error
- From: Thorsten Glaser <tg@mirbsd.de>
- Date: Wed, 27 Jun 2012 10:58:33 +0000 (UTC)
- Message-id: <Pine.BSM.4.64L.1206271057500.3110@herc.mirbsd.org>
Hi,
this is fixed with the pdksh → mksh migration.
bye,
//mirabilos
--
13:37⎜«Natureshadow» Deep inside, I hate mirabilos. I mean, he's a good
guy. But he's always right! In every fsckin' situation, he's right. Even
with his deeply perverted taste in software and borked ambition towards
broken OSes - in the end, he's damn right about it :(! […] works in mksh
--- End Message ---