I don't understand what you're using filter_ext_search
for, but here:
filter_ext_search=$( camcontrol devlist |
awk -F ',da' '/External/ {print "/dev/da" substr($2, 0, 1)}'
)
while read disk_ident_nr; do
case "$disk_ident_nr" in
57442D574341553439373933353130) echo video mode ;;
somethingelse) echo photo mode ;;
esac
done < <(geom disk list da2 | grep 'ident:' | cut -d\ -f5-)
Redirecting the output of <(process substitution)
into the while loop allows your loop to run in the current memory environment, avoiding Bash Pitfall #8.