Automation often runs the same operation over a named batch of files. A case statement can map the batch name to a stable work set.

Program

Play the script to choose a batch and see how many files it selects.

batch_select.sh
#!/usr/bin/env bash

batch=
case "$batch" in
    logs) files=("app.log" "db.log") ;;
    reports) files=("sales.csv" "audit.csv") ;;
esac
count=${#files[@]}
echo "$batch:$count"
#!/usr/bin/env bash

batch=
case "$batch" in
    logs) files=("app.log" "db.log") ;;
    reports) files=("sales.csv" "audit.csv") ;;
esac
count=${#files[@]}
echo "$batch:$count"
batch A batch name is a compact handle for a repeatable set of work.
case map `case` keeps the mapping from names to work sets explicit.
array count `${#files[@]}` counts selected array elements.