Adding '-u' to sort removes doubled entries from a list: n22 ~ # echo $(awk '$1 != "none" { print $2 }' /proc/mounts | sort -r) /sys /proc/bus/usb /proc /dev/pts /dev / / n22 ~ # echo $(awk '$1 != "none" { print $2 }' /proc/mounts | sort -ur) /sys /proc/bus/usb /proc /dev/pts /dev / Here is the diff: n22 ~ # diff -u halt.sh /etc/init.d/halt.sh --- halt.sh 2005-06-16 10:37:40.000000000 +0200 +++ /etc/init.d/halt.sh 2005-06-16 10:49:58.000000000 +0200 @@ -192,7 +192,7 @@ # Get better results with a sync and sleep sync; sync sleep 1 - for x in $(awk '$1 != "none" { print $2 }' /proc/mounts | sort -r) ; do + for x in $(awk '$1 != "none" { print $2 }' /proc/mounts | sort -ur) ; do x=${x//\\040/ } if [[ ${cmd} == "u" ]]; then umount -r -r "${x}" Reproducible: Always Steps to Reproduce: 1. 2. 3.
thanks ... i think the reason this didnt come up was no one expected it :) now in cvs