From: Lewis Butler <lbutler@covisp.net>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Paramater subsiution
Date: Mon, 28 Jun 2021 16:33:20 -0600 [thread overview]
Message-ID: <0E863B7C-7435-47C5-A7BE-6FFC470BEAE6@covisp.net> (raw)
In-Reply-To: <b135aad4-af98-4f58-8ad7-36a16dbfdbf7@vivaldi.net>
On 27 Jun 2021, at 16:47, Gamma <GammaFunction@vivaldi.net> wrote:
> Jun 27, 2021 17:42:48 Lewis Butler <lbutler@covisp.net>:
>
>> Given:
>>
>> name="file 1234 - name"
>> echo ${I% - name}
>>
>> I can easily get 'file', but how would I get "name" instead given that:
>>
>> o name and 1234 are variable lengths and values
>> o "file" and " - " are constant across all the input
>
> echo ${i##* - }
<thunks head on desk>
> Removes the longest prefix ending with ' - '.
>
> Check man zshexpn for more.
I swear I knew that at one point, but missed it several times in reading the man page.
Thank you.
--
ɹןʇnqן
<mailto:lbutler@covisp.net>
tel:+1.303.219.0564
prev parent reply other threads:[~2021-06-28 22:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-27 22:40 Lewis Butler
2021-06-27 22:47 ` Gamma
2021-06-28 5:34 ` Lawrence Velázquez
2021-06-28 22:33 ` Lewis Butler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0E863B7C-7435-47C5-A7BE-6FFC470BEAE6@covisp.net \
--to=lbutler@covisp.net \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).