Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: newline grief
- X-seq: zsh-users 23126
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>, zsh-users@xxxxxxx
- Subject: Re: newline grief
- Date: Sat, 10 Feb 2018 21:36:34 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=q85vv6 VVl8vHFoxfKRHjDtbaCJrrBjbn6Gag8Nm4N6Q=; b=cL4UaTWVQITFv0a52mJyBG DPCP6kXZNO6Nkgx9Sh9CxE1E0jBvMJ4Gx8U1+8ewFf2wdhHIEhRCDkx6Dh38beiE 15+1+C7z0ICyWWLfYfbKpCgC6xaw8y3efgRsOrdKph0IQGDtwxAwpgVNmv+swb90 4WJU0EEQY9mGg2H0PUAKPqYBGY9QQ+im4mlm5CAs19KKCEZwmbwtzYQ99jPtJcX2 3bnVFZUEHrYGG00QD1F84gR6CYrR9TgkUNaEdxSXRqSHwG3jaab24xI36Vv3GU+x CWXcYPQ/o+kw+UTeQRKt6TOa8sjjJAoUFgzovGvSKuhHvlnm4Js4FsRfNdatLnVg ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=q85vv6 VVl8vHFoxfKRHjDtbaCJrrBjbn6Gag8Nm4N6Q=; b=C6XtA/X1uZbpAuRYei18Nx aU0W8G1RZsc7Yo7KZgAXpJa6DXSlI89/mD6LcRq325KQvC8582zmsQcXJyNOeFFL R7uDHbyKZuAG6HZlOkH9S4LW+ci4Xm/g3hgtL1FvhR2VulcVVfYhIr9jyFJMFFae NO14H2oavbyzSfFVhD4P8pjRclMcloskQ2JdFRa17UXqjcH2J/4yqvG+ysSsabkL w2F1jcSS56jN3klkkRwkTfx8JuvGCtrJvXB4iaa1lxFcUVVNI50WBWqp0r3kIK7R 53HC4Wr6fENtlq+25WwzRK3t5o40PbpgJ/YAtQ/ydz/vaBe8NA8jfacKBSwKb+1w ==
- In-reply-to: <a43d273c-8f7b-e38b-e9b1-e3afd546ad53@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <03c557f4-e55e-f33d-6875-fedbb99212b8@eastlink.ca> <e85defb8-e026-2232-33bd-20deb36f330c@gmx.com> <1518292490.2957397.1266471496.0E56DD5C@webmail.messagingengine.com> <a43d273c-8f7b-e38b-e9b1-e3afd546ad53@eastlink.ca>
Ray Andrews wrote on Sat, 10 Feb 2018 13:04 -0800:
> On 10/02/18 11:54 AM, Daniel Shahaf wrote:
> > Eric Cook wrote on Sat, 10 Feb 2018 14:46 -0500:
> >> for aa in "${(f)$(typeset -m 'var*')}"; do
> > There's an API for this information:
> >
> > for parameter_name in ${(k)parameters[(I)var*]} ; do
> >
> >
> What do you mean "an API"? Application Program Interface ??
Yes. ${parameters} is an interface, as opposed to parsing the output
of `typeset` which isn't designed to be used this way (it's designed to
be eval'd).
> $ for parameter_name in ${(k)parameters[(I)var*]} ; do set $
> {parameter_name}=; done
>
> ... arbitrary list of variables all nulled. This could be useful for
> cleaning up after some messy function.
That will set them to empty. If you want to unset them you can use
'... do unset ${parameter_name}; done', but at that point just 'unset -m
"var*"' would be equivalent and more efficient.
And you should complain to the author of that function to declare his
variables local, see WARN_CREATE_GLOBAL :-)
Cheers
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author