Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: variable expansion which will remove a file extension



* 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