Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Equivalent of set -- *(DN) in sh
- X-seq: zsh-users 19741
- From: Nikolai Weibull <now@xxxxxxx>
- To: Roman Neuhauser <neuhauser@xxxxxxxxxx>
- Subject: Re: Equivalent of set -- *(DN) in sh
- Date: Sun, 18 Jan 2015 20:43:55 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=ss0an5FZ/gHwufD877w+TeesC167hHS7L7120x23ic8=; b=AbPHYpRGGa4RcM5cpVzEnxPDkjwDGngXomZKD6BJr6bb4uKu9TduvaV38HkJHoP59i JUN/pjIOAqzL1BOWsZe/92t7uUHJkUwfg6uySUeUBah3Em9X37ywQCly7w9lYv6+9gRS +rEx9zMoo5qcfRxMK2wk4nqKxmYZ+2njH/Zgvslb47zYTjdZMkXvDFN6fKZ7IYZwDsC6 OAcXyMD6bNf0MHbuw6f1ZWRHxC52TtCTZY9vxSAuX1G+J7n+X3GEfcQA96pg0SgT6mJz eQowVlcSbZ59BEjEwxyoPWXhzZAB+N0pXdpTSBGF8rIl/tO4HK8aHNiaBXhvBmnIHrw5 1RdQ==
- In-reply-to: <20150118190723.GG979@isis.sigpipe.cz>
- 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: <CADdV=MvMtwYczr82GeYkmVwTFCKgFcbgYS71XdnHZN_JqFqzTg@mail.gmail.com> <20150118190723.GG979@isis.sigpipe.cz>
- Sender: nikolai.weibull@xxxxxxxxx
On Sun, Jan 18, 2015 at 8:07 PM, Roman Neuhauser <neuhauser@xxxxxxxxxx> wrote:
> # now@xxxxxxx / 2015-01-18 19:28:42 +0100:
>> Is there any way to get the equivalent of Zsh´s
>>
>> set -- *(DN)
>>
>> in sh? Most important here would be NULL_GLOB, as, by default, sh
>> simply leaves the * if there are no files to match.
>
> set -- $(find .* * -maxdepth 0 -type d)
>
> does not handle names with spaces.
Which is unsatisfactory, as $() isn’t in all versions of sh, -maxdepth
is GNU specific, and .* and * will be expanded by the shell, not by
find, so we’ve gained nothing and lost quite a bit. Oh, and who said
anything about only including directories? ;-)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author