Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

shell tip: get parts of a filename

Tags: echo

# works in bash, zsh and ksh93~$ f=file.tar.bz2~$ Echo "${f##*.}"bz2~$ echo "${f#*.}"tar.bz2~$ echo "${f%.*}"file.tar~$ echo "${f%%.*}"file



This post first appeared on Unix Art, please read the originial post: here

Share the post

shell tip: get parts of a filename

×

Subscribe to Unix Art

Get updates delivered right to your inbox!

Thank you for your subscription

×