[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
- Question about case statement in Bash docs,
AlvinSeville7cf <=
Re: Question about case statement in Bash docs, Chet Ramey, 2021/05/10