-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2201
koalaman edited this page Dec 31, 2016
·
2 revisions
[[ "$file" = index.{htm,html,php} ]] && echo "This is the main file"
for main in index.{htm,html,php}
do
[[ "$file" = "$main" ]] && echo "This is the main file"
done
Brace expansions doesn't happen in [[ ]]
. They will just be interpreted literally.
Instead, use a for
loop to iterate over values, and apply your condition to each.
None.