
On Fri, 2005-08-12 at 11:35 +1200, Jonathan Purvis wrote:
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.
You can get what you want by changing $IFS (bash's input field separator): IFS=; for name in `/bin/ls -1 | sort -r` ; do echo $name ; done -- Colin Palmer <colinp(a)waikato.ac.nz> University of Waikato, ITS Division