4 ms·
Eliminate the temporary file: sed -e "s/./x/g" < list.txt | paste - list.txt | sort | cut -f 2
by jloughry 13y ago
Eliminate the temporary file:
sed -e "s/./x/g" < list.txt | paste - list.txt | sort | cut -f 2
- jloughry 13y agoWe can eliminate the paste by using sed's hold buffer, but it costs another regexp to get rid of the spurious newline: sed -e "h;s/./x/g;G;s/\n/\t/g" list.txt | sort | cut -f2