Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: string overwrites string when echoed
- X-seq: zsh-users 22885
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: string overwrites string when echoed
- Date: Sun, 10 Sep 2017 17:59:43 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1505062784; bh=oVPfy00yK7BQTnwVatFVuAS2Zmy4Yb3efNdTpb0Fq9w=; h=Date:From:To:Subject:In-Reply-To:References; b=REuUPRZ67AUZCRelIIloog8Sgyq3oY4NQtdDYX990nj3GIBBVY9nVEc5ztHzsM51l Zn1Van2V/aKC4xiShvyWwP/uyUtNLVtQdjG95WvqkfDnWpuFGkpgNh1J4U6XvB4NM7 FMeozPJPeHbyrHmfbeq5IuMYNZ1dXw+HPj01cpSW8jkET8qfF0Qc5PSNhLKp5TEMwf t+YjML/vFwCi7CZeT6uihsSmEHZJgH5ssbPGMYo0rOEM6uT6fhXEpLYOG8u0RZ/VrP tnfFUKeBxULxyEAmvp1MA9f92OI075ViGsNk0HCHsVFZ4OMdeb2hoZNVC89jFR4XA0 5BbudkHwnsi0g==
- In-reply-to: <86shfumrzm.fsf@zoho.com>
- 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: <86o9qkqbes.fsf@zoho.com> <170909100149.ZM8451@torch.brasslantern.com> <86shfumrzm.fsf@zoho.com>
On Sun, 10 Sep 2017 18:35:25 +0200
Emanuel Berg <moasen@xxxxxxxx> wrote:
> Bart Schaefer wrote:
>
> > The value of $reply has an embedded
> > carriage-return. You can see this if you use:
> >
> > echo "$u ${(V)reply}" echo "${(V)reply} $u"
>
> echo "${(V)reply} $u" works, only how do I drop
> the ^M then?
Replacing $reply with ${reply%%$'\r'} would do the trick.
There may be something you can do with stty, but that's
a bit out of the scope of the shell (or indeed sanity :-().
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author