bug-bash
[Top][All Lists]
Advanced

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

Question about case statement in Bash docs


From: AlvinSeville7cf
Subject: Question about case statement in Bash docs
Date: Mon, 10 May 2021 21:12:33 +1000

   Hello! Let’s consider the following snippet from [1]Bash docs:
case word in
    [ [(] pattern [| pattern]…) command-list ;;]…
esac


   It is written that: Each pattern undergoes tilde expansion, parameter
   expansion, command substitution, and arithmetic expansion. But if it’s
   true why the following code outputs Y?


   x=test


   case $x in

       "test") echo Y

   esac


   Pattern is quoted but no quote removal is performed according to docs.


   alvinseville7cf@Alvins-MacBook-Pro ~ $ echo -e "Best regards,
   \e[33m$(whoami)\e[0m." && exit $SUCCESS_EC

References

   1. https://www.gnu.org/software/bash/manual/bash.html#Conditional-Constructs


reply via email to

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