Sample Header Ad - 728x90

How to specify several alternative conditions (OR operator) for single case statement? (Or Alternatively, where is shell case syntax description?)

-1 votes
1 answer
113 views
I want something like this:
time="1m"
case "$time" in
    *h*) 
    *m*) 
    *s*) 
        echo "handling several cases for h, m, s tokens" ;;
    *)
        echo "handling other cases" ;;
esac
How to achieve this for POSIX shell?
Asked by Anton Samokat (289 rep)
May 10, 2024, 02:08 PM
Last activity: Jun 9, 2024, 06:35 AM