Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: spaces in filenames should be a crime.
- X-seq: zsh-users 22618
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: spaces in filenames should be a crime.
- Date: Sun, 26 Mar 2017 15:41:42 -0700
- In-reply-to: <20170326211805.GA8170@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <0c1b9d89-edd0-a027-e2f1-d01c2d68fa4e@eastlink.ca> <20170326211805.GA8170@fujitsu.shahaf.local2>
On 26/03/17 02:18 PM, Daniel Shahaf wrote:
Thanks all:
Yes, Vadim's fix seems to be fine. Nuts, I still don't have much sense
of the logic of these things.
You could replace the whole function with:
mostrecent() { ls -l -- **/*(.om[1]) }
Yeah, my original was just something I found on the net and didn't
bother to improve upon until it crashed and burned on a space in the
directory name. I'm not surprised that our 'ls' can do it all by itself.
You can then use [1,3] to select several files.
Very fine. Not forgetting to add '-U' to 'ls'. Mind, why is that
needed, since the input is not redirected from some other program it
seems strange to have to tell it not to resort incorrectly what has been
specifically requested, no?
Another option here is to use find -print0 with ${(0)}. That only
matter if you need to DTRT when filenames contain NL characters.
DTRT?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author