My Tech Notes
Search This Blog
Shell Script: remove file extension
Use sed:
echo "file.txt" | sed 's/\(.*\)\..*/\1/'
Use bash string operations:
f="filename.txt"; echo "${f%.*}"
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment