Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Equivalent of set -- *(DN) in sh
- X-seq: zsh-users 19742
- From: Nikolai Weibull <now@xxxxxxx>
- To: ZyX <kp-pav@xxxxxxxxx>
- Subject: Re: Equivalent of set -- *(DN) in sh
- Date: Sun, 18 Jan 2015 20:46:40 +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=Jm2CqS96dkl0o/EVbOY7rtzTwjx6/So6D0Lu3MmhhoM=; b=HruUaxa8Q/MohsgvF5eMAfhXhunRSQJymzmhE3WlDSusOnoccSpU2XavCfAfE9DDOb Z8cJEZzecEQZfDj2ZaThyqprXpdGvXHZ0w0nRH1aLDYr69CVbIm7RDwvWQiaZ5qJl5y/ WwJIMoMChX6imFqyLqfQU4Ac3SDjn/Nt3KDoUs4O90ZlI3YIS8GFg9ueT1wVKHCbKV4A NJs+fiCRxhy3ihuNjrdUtN5syDoW0lf0K2dtNbtMnSd7etbn+L1f67VrChdh+fL1sQ7Z quQ9e0SdpjO5HrPQlB5mOzNAmvDvPAEhkDFQEf6n9kQaOMBo06f0M6T1/jbUJFAKOTii qm6Q==
- In-reply-to: <4640221421609498@web10g.yandex.ru>
- 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> <4640221421609498@web10g.yandex.ru>
- Sender: nikolai.weibull@xxxxxxxxx
On Sun, Jan 18, 2015 at 8:31 PM, ZyX <kp-pav@xxxxxxxxx> wrote:
> 18.01.2015, 21:36, "Nikolai Weibull" <now@xxxxxxx>:
>> 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.
> If you are OK with bash then you may use `shopt -s nullglob; shopt -s dotglob` and use `set -- *`.
I’m not. Depending on Bash is like depending on Zsh these days, I’d
say, in terms of availability.
> Note that solution posted by Roman Neuhauser does handle names with spaces and tabs, but not newlines, if you set $IFS to a newline. As-is it has problems with all characters in IFS which are not just space, but also tab and newline.
The solution has to be functionally equivalent.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author