bridge.sh: improve string cut