Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Undoing mv foo.txt{,_}
- X-seq: zsh-users 21843
- From: Vincent Bernat <bernat@xxxxxxxx>
- To: René Wilhelm <rene.wilhelm@xxxxxxxxx>
- Subject: Re: Undoing mv foo.txt{,_}
- Date: Wed, 07 Sep 2016 06:54:15 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=luffy.cx; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=postfix; bh=j10vvFfOidJzS8mWChEgYYrgvw8=; b=hqH XINL/Qu4XgYLyBU5h8C+iAwkMvBX/eILJyXRwYetDuoPHryUht/nTNapiNK5/h3v hSql9Z92tqGgAn/fNCkuL8NRtpjt6RupT/tLSJqnRSY2A11q2nKVJzUzWZuNS/y1 iG8E+4Blui3ide8nIPjKPLUXEmvLkzc/m9UMrjBU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=luffy.cx; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=postfix; b=kIQxOHlmO0kLGQwa4uB4KtCUXvuwG 1rw0LZzBst6Hsri4i7Te8hsIYnwnSEZKEQM1DfMmuPoD1ecSVQaeAMFKq6V300OP ZI1eI3x8dcbLcFhRJsJtP9Ca19FB62PdCamYBtK24Tf65Sm31WAie3sQ9xih3ndX +T5YfXkPSNnhtY=
- In-reply-to: <CA+oFM6KxR2tZygyYzhZynsXzqHOroNc6WeG=QbTZPqTwra+-cw@mail.gmail.com> ("René Wilhelm"'s message of "Tue, 6 Sep 2016 19:04:05 +0200")
- 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: <CA+oFM6KxR2tZygyYzhZynsXzqHOroNc6WeG=QbTZPqTwra+-cw@mail.gmail.com>
❦ 6 septembre 2016 19:04 CEST, René Wilhelm <rene.wilhelm@xxxxxxxxx> :
> What's a good way to move file.txt_ back to file.txt, or more general: how
> to remove the suffix of a string, without putting it in a variable first
> (e.g. a=foo.txt; mv $a $a:r)?
About not using a variable, there is the ${:-...} pattern:
echo ${${:-foo.txt}:r}
--
Make sure all variables are initialised before use.
- The Elements of Programming Style (Kernighan & Plauger)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author