Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: test for newline in a variable--unexpected results sometimes
- X-seq: zsh-users 23643
- From: lilydjwg <lilydjwg@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: test for newline in a variable--unexpected results sometimes
- Date: Mon, 17 Sep 2018 11:20:11 +0800
- Cc: zsh-users@xxxxxxx
- Disposition-notification-to: lilydjwg@xxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :disposition-notification-to:user-agent; bh=9FWF7is9gsHg+m273wlFadUF6LQnqPAA/pwSQI5RQVw=; b=s2IY8I+kGhxvM2zvy6gbe+Q4wWyXxF+cKXmf7Sc7QsyFXNSNZKhjC92UnVwGtyINO3 eyc4BhZ0z7fTqp/t2DXzMnBubjJWmI7D9TCOk8KbvaRaTQgZpH6s6an9tCvIoXhVh+jX aUWUzVTApAbaqinlUoMVXhtLedHuxP2EAIjTTka7dhVk3ZTV4kfEn9Nd8Rs2wJusQUbI GKHr54rBS8TzqpKEXl3pZG+d8eEmZ7u94hjnMdywRlTcEaSYNJwBvuBLV/Q5N8Ux4+Ba vcAQmtFhfcmhOSMLlRzPJtol9sTBRGxGLwxHNE+3JWPToNaKho6MvhYNLLzCar3xcddi XAZQ==
- In-reply-to: <20180916204433.6k36inmuekgqp3a2@tarpaulin.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>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20180916172716.GA27892@lilyforest.localdomain> <20180916204433.6k36inmuekgqp3a2@tarpaulin.shahaf.local2>
On Sun, Sep 16, 2018 at 08:44:33PM +0000, Daniel Shahaf wrote:
> In this context, «\n» does not mean a newline; it means either the letter 'n',
> or the two-character sequence «\n», but I don't remember which.
Thanks! Problem solved.
> > cmd2="cd \ncd /sys/class/leds"
>
> Ditto.. If you try «xxd <<<$cmd2» you'll see the variable's value contains the
> two-character sequence «\n».
I echoed it, and it turns out that echo itself turned all \n into real newlines.
--
Best regards,
lilydjwg
Messages sorted by:
Reverse Date,
Date,
Thread,
Author