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

Re: variable expansion which will remove a file extension



zzapper wrote:
Hi,
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:]]*/}

How about:

zip=${file%.*}

-Dom



Messages sorted by: Reverse Date, Date, Thread, Author