Behaviour of an empty conditional expression is undefined?

2023-02-23 Thread Qingsheng Huang
Here shows the output of conditional expressions: infinite:~# [[ ]] -bash: syntax error near unexpected token `]]' infinite:~# [[ ]] infinite:~# [[ "$A" ]] -bash: syntax error near unexpected token `"$A"' infinite:~# [[ "$

Behaviour of an empty conditional expression is undefined?

2023-02-23 Thread Qingsheng Huang
Here shows the behavious of empty conditional expressions: infinite:~# [[ ]] -bash: syntax error near unexpected token `]]' infinite:~# [[ ]] infinite:~# [[ "$A" ]] -bash: syntax error near unexpected token `"$A"' infinite:~#

Re: Behaviour of an empty conditional expression is undefined?

2023-02-23 Thread alex xmb ratchev
i [[ daily , never had such.. sounds like u dont type in C in utf8 On Thu, Feb 23, 2023, 9:58 AM Qingsheng Huang wrote: > Here shows the behavious of empty conditional expressions: > > > infinite:~# [[ ]] > -bash: syntax er

Re: Behaviour of an empty conditional expression is undefined?

2023-02-23 Thread Kerin Millar
On Thu, 23 Feb 2023 16:26:43 +0800 (CST) "Qingsheng Huang" wrote: > Here shows the behavious of empty conditional expressions: > > > infinite:~# [[ ]] > -bash: syntax error near unexpected token `]]' > infinite:~# [[ ]] > i

Re: Behaviour of an empty conditional expression is undefined?

2023-02-23 Thread Kerin Millar
On Thu, 23 Feb 2023 11:07:52 +0100 alex xmb ratchev wrote: > i [[ daily , never had such.. This observation isn't helpful unless you account for which version of bash you are using. In any case, the report is accurate and it describes a post-5.1 regression. -- Kerin Millar

Re: Behaviour of an empty conditional expression is undefined?

2023-02-23 Thread alex xmb ratchev
On Thu, Feb 23, 2023, 11:14 AM Kerin Millar wrote: > On Thu, 23 Feb 2023 11:07:52 +0100 > alex xmb ratchev wrote: > > > i [[ daily , never had such.. > > This observation isn't helpful unless you account for which version of > bash you are using. In any case, the report is accurate and it descri

Re: Behaviour of an empty conditional expression is undefined?

2023-02-23 Thread Koichi Murase
2023年2月23日(木) 17:58 Qingsheng Huang : > The variable $A has never been defined. > Double brackets surrounding 1) a few spaces or 2) an empty variable even > quoted behave illogically. I've also try different lengths of spaces, and > also an empty variable without quotes, the same illogical. > > I

Re: Behaviour of an empty conditional expression is undefined?

2023-02-23 Thread Chet Ramey
On 2/23/23 3:26 AM, Qingsheng Huang wrote: Here shows the behavious of empty conditional expressions: infinite:~# [[ ]] -bash: syntax error near unexpected token `]]' infinite:~# [[ ]] infinite:~# [[ "$A" ]] -bash: syntax e