I would like to do something like this where on Friday, the output is for both conditions that match:
#!/bin/bash #!/bin/bash NOW=$(date +"%a") case $NOW in Mon) echo "Mon";; Tue|Wed|Thu|Fri) echo "Tue|Wed|Thu|Fri";; Fri|Sat|Sun) echo "Fri|Sat|Sun";; *) ;; esac
As the code above is written, the only output on Friday would be:
Desired output on Friday:
I understand that normally, only the commands corresponding to the first pattern that matches the expression are executed.
Is there a way to execute commands for additional matched patterns?
EDIT: I am not looking for fall-through behavior, but that's also a nice thing to know about. Thanks steeldriver.