custom message for vm_query_exit
[minix3.git] / releasetools / sort_set.sh
blob6da42403a0178712ad8665abb5713d962ec59b3d
1 #!/bin/sh
3 # kinda natural sorting for sets
4 # prepend every line with a modified path where
5 # slashes are replaced by "1" and "0" is added
6 # at the end of the string.
7 #
8 # entry
9 # ./bin/cat minix-sys
10 # becomes
11 #.1bin1cat0 ./bin/cat minix-sys
13 # This entry gets sorted after wich the key is removed using
14 # cut
16 # Additionally all lines starting with "#" are put on
17 # top in the order they where put in the file. this is done
18 # by creating a "key" with the value COUNTER
20 COUNTER=10000
21 while read i
23 A=$(echo $i | cut -f 1 -d ' ' | sed "s,^#,00$COUNTER,g" | sed 's,/,1,g' )
24 echo "${A}0 $i"
25 COUNTER=$(($COUNTER +1))
26 done | sort | cut -d ' ' -f 2-