Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Strip a Carriage-Return from a string/variable
- X-seq: zsh-users 14319
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Strip a Carriage-Return from a string/variable
- Date: Tue, 25 Aug 2009 18:13:08 +0200
- In-reply-to: <Xns9C72ADE69DF67zzappergmailcom@xxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <Xns9C72ADE69DF67zzappergmailcom@xxxxxxxxxxxx>
zzapper <david@xxxxxxxxxx>:
> print ${somevar//[^[:alnum:]]/_} # replace all non-alphanumerics with _
>
> But how to delete just a trailing or not carriage return?
cr=$'\r'
print ${foo//${cr}/_}
Regards, Frank
Messages sorted by:
Reverse Date,
Date,
Thread,
Author