
A. Pagaltzis wrote:
That’s not very helpful to people who have no set of suitable files to check the output… can you give examples of what you expect and what you are getting?
Make yourself and empty directory and try these 3 commands: touch file\ 1 file\ 2 file\ 3 for name in * ; do echo $name ; done for name in `ls -1 | sort -r` ; do echo $name ; done I'd like some way of making the output of the 3rd command be the output of the 2nd, only reversed. Instead it prints a line break instead of a space as bash as split the arguments given to for on spaces. Trying various combinations of quoting or escaping don't help: for name in `ls -1 | sort -r | sed 's/ /\\\\ /g'` ; do echo $name ; done for name in `ls -1 | sort -r | sed -e 's/^/"/' -e 's/$/"/'` ; do echo $name ; done for name in `ls -1 | sort -r | sed -e 's/ /\\\\ /g' -e 's/^/"/' -e 's/$/"/'` ; do echo $name ; done