bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: yet another $(case ... parse bug


From: felix
Subject: Re: yet another $(case ... parse bug
Date: Fri, 21 Jun 2024 09:08:25 +0200

Le Thu, May 23, 2024 at 08:19:49PM +0300, Oğuz a écrit :
> 
> $ bash -c 'for (( $(case x in x) esac);; )); do :; done'
>From there, I've tested:

  bash-5.3-alpha$ uname=1
  bash-5.3-alpha$ echo $(( uname - $(echo 1) ))
  0
  bash-5.3-alpha$ echo $(( uname - $(case x in x) echo 1;exit;;esac;echo 0) ))
  uname: extra operand '-'
  Try 'uname --help' for more information.

Which could be avoided by using double quotes:

  bash-5.3-alpha$ echo $(( uname - "$(case x in x) echo 1;exit;;esac;echo 0)" ))
  0

-- 
 Félix Hauri  -  <felix@f-hauri.ch>  -  http://www.f-hauri.ch



reply via email to

[Prev in Thread] Current Thread [Next in Thread]