Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Andreas Kusalananda Kähäri
On Sun, Feb 14, 2021 at 12:02:02AM +0100, Andreas Schwab wrote: > On Feb 14 2021, Robert Elz wrote: > > > Date:Sat, 13 Feb 2021 23:21:36 +0300 > > From:=?UTF-8?B?T8SfdXo=?= > > Message-ID: > > > > > > | $ bash -c ': $(case x in x) esac)' > > > > This is a well k

Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Lawrence Velázquez
> On Feb 13, 2021, at 5:21 PM, Robert Elz wrote: > > This problem has been known for a LONG time, without it being fixed. I played around with shbot on Freenode for a bit. "LONG time" is right: bash50 -c ': $(case x in x) esac)' bash50: -c: line 0: unexpected EOF while looking for matching `

Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Oğuz
14 Şubat 2021 Pazar tarihinde Robert Elz yazdı: > Date:Sat, 13 Feb 2021 23:21:36 +0300 > From:=?UTF-8?B?T8SfdXo=?= > Message-ID: j...@mail.gmail.com> > > | $ bash -c ': $(case x in x) esac)' > > This is a well known bash deficiency. When parsing command substit

Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Andreas Schwab
On Feb 14 2021, Robert Elz wrote: > Date:Sat, 13 Feb 2021 23:21:36 +0300 > From:=?UTF-8?B?T8SfdXo=?= > Message-ID: > > > | $ bash -c ': $(case x in x) esac)' > > This is a well known bash deficiency. When parsing command substitutions > it (approximately) simpl

Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Robert Elz
Date:Sat, 13 Feb 2021 23:21:36 +0300 From:=?UTF-8?B?T8SfdXo=?= Message-ID: | $ bash -c ': $(case x in x) esac)' This is a well known bash deficiency. When parsing command substitutions it (approximately) simply counts (unquoted) parentheses to find the end. An

Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Andreas Kusalananda Kähäri
On Sat, Feb 13, 2021 at 03:41:30PM -0500, Lawrence Velázquez wrote: > > On Sat, Feb 13, 2021, 21:34 Alex fxmbsw7 Ratchev wrote: > > > > you didnt end the case, wrong syntax > > echo $( case x in y) printf 1 ;; x) printf 2 ;; esac ) > > $ case x in x) esac > $ echo $? > 0 > > > On Feb 13, 2021,

Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Lawrence Velázquez
> On Sat, Feb 13, 2021, 21:34 Alex fxmbsw7 Ratchev wrote: > > you didnt end the case, wrong syntax > echo $( case x in y) printf 1 ;; x) printf 2 ;; esac ) $ case x in x) esac $ echo $? 0 > On Feb 13, 2021, at 3:36 PM, Alex fxmbsw7 Ratchev wrote: > > you have to specify something for ) even w

Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Alex fxmbsw7 Ratchev
you have to specify something for ) even when its just a * wildcard On Sat, Feb 13, 2021, 21:34 Alex fxmbsw7 Ratchev wrote: > you didnt end the case, wrong syntax > echo $( case x in y) printf 1 ;; x) printf 2 ;; esac ) > > On Sat, Feb 13, 2021, 21:21 Oğuz wrote: > >> $ bash -c ': $(case x in

Re: syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Alex fxmbsw7 Ratchev
you didnt end the case, wrong syntax echo $( case x in y) printf 1 ;; x) printf 2 ;; esac ) On Sat, Feb 13, 2021, 21:21 Oğuz wrote: > $ bash -c ': $(case x in x) esac)' > bash: -c: line 1: unexpected EOF while looking for matching `)' > bash: -c: line 2: syntax error: unexpected end of fil

syntax error while parsing a case command within `$(...)'

2021-02-13 Thread Oğuz
$ bash -c ': $(case x in x) esac)' bash: -c: line 1: unexpected EOF while looking for matching `)' bash: -c: line 2: syntax error: unexpected end of file `case x in x) esac' is a complete case command, a syntax error is unexpected here. -- Oğuz