Shows:
- how to remove duplicate slashes in file (see http://stackoverflow.com/questions/4638983/remove-unnecessary-slashes-from-a-given-path-with-bash)
- how to change and recover
shopt
x=..//some/path/with///multiple/slashes//
shoptbak=$(shopt -p extglob)
shopt -s extglob
x=${x//\/*(\/)/\/}
eval ${shoptbak}
echo $x