Wednesday, December 28, 2011

bash: remove file extension


To get filename without extention try this:

Code:
file='file.txt'
name=${f%\.*}


or



# echo file_name.jpg  | sed 's/\(.*\)\..*/\1/'
file_name
#


No comments: