Sample Header Ad - 728x90

Case fallthrough based on if condition

13 votes
9 answers
4504 views
I am looking for a way to have fallthrough happen based on an if condition within a case condition in bash. For example: input="foo" VAR="1" case $input in foo) if [ $VAR = "1" ]; then # perform fallthrough else # do not perform fallthrough fi ;; *) echo "fallthrough worked!" ;; esac In the above code, if the variable VAR is 1, I would like to have the case condition perform fallthrough.
Asked by Smashgen (403 rep)
May 28, 2018, 07:07 PM
Last activity: Apr 10, 2024, 09:00 PM