Skip to main content
added 32 characters in body
Source Link
TKHN
  • 97
  • 1
  • 2
  • 10

I am comparing string in case statement as below : input variable can be D P KL ...

case $input in D|P|Q|L1|L2) val="Hello";; DD|DE|DF|CA) val="Hi" ;; MM|KL||TK|SZ) val="Bye" ;; echo $input 

input variable not printing anything..

I am comparing string in case statement as below :

case $input in D|P|Q|L1|L2) val="Hello";; DD|DE|DF|CA) val="Hi" ;; MM|KL||TK|SZ) val="Bye" ;; echo $input 

input variable not printing anything..

I am comparing string in case statement as below : input variable can be D P KL ...

case $input in D|P|Q|L1|L2) val="Hello";; DD|DE|DF|CA) val="Hi" ;; MM|KL||TK|SZ) val="Bye" ;; echo $input 

input variable not printing anything..

Source Link
TKHN
  • 97
  • 1
  • 2
  • 10

Compare multiple string in case shell script

I am comparing string in case statement as below :

case $input in D|P|Q|L1|L2) val="Hello";; DD|DE|DF|CA) val="Hi" ;; MM|KL||TK|SZ) val="Bye" ;; echo $input 

input variable not printing anything..