Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: string to array space problem in filenames



On 09/02/2015 10:25 PM, Bart Schaefer wrote:

Thank you gentlemen, like riding a bike, it's easy if you know how:
You mean like:

     print -l "${array[@]}" > file


Previous similar invocations of 'print' seemed to need this form:

	print -rlu2 "${array[@]}" > file

... which I took on faith, but as Bart shows, it seems that in this situation the 'ru2'
are bad medicine.

So my array reads/writes to file looking like this:


/root
/boot
/aWorking/Zsh
/root/.icedove/Ray/Mail/Local Folders
/aRay
/etc
/aWorking

... spaces are protected, and it compresses fine.  And  select is happy.
If it still works on Tuesdays so am I.
So it was a useful exercise even if I now go on to see that 'cdr' does it
all better anyway.



Messages sorted by: Reverse Date, Date, Thread, Author