joukewitteveen/netcfg — comment on commit 10a01a13d3e849e576dadd5ca39be67c632f9f3a
File: scripts/wifi-menu line 109
By falconindy:

Please don't use expr. bash's string functions should be fine here. something like...

if [[ $flags = *@(WPA|WEP) ]]; then
security=${flags:(-3)}
else
security=NONE
fi