Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: variable expansion which will remove a file extension
- X-seq: zsh-users 10044
- From: Christian Schneider <strcat@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: variable expansion which will remove a file extension
- Date: Sat, 18 Mar 2006 01:42:28 +0100
- In-reply-to: <Xns9789F2DC127DFzzappergmailcom@xxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Born to frag.
- References: <Xns9789F2DC127DFzzappergmailcom@xxxxxxxxxxx>
* zzapper <david@xxxxxxxxxx> typed:
> How do I write a variable expansion which will remove a file extension eg
> fred.tex -> fred
>
> This is what I hacked:-
>
> zip=${file//\.[[:alnum:]]*/}
Use ``${foo:r}''. ":r" remove a filename extension; its described in
zshexpn(1) /Modifiers
Messages sorted by:
Reverse Date,
Date,
Thread,
Author