Article 5D1Q3 help clip file extension in bash

help clip file extension in bash

by
mike acker
from LinuxQuestions.org on (#5D1Q3)
any hints / help will be appreciated!!

I'm working in a bash script

I have a file name (e.g.) message.txt.asc

I need to get the plaintext name: message.txt

For some reason I cant get the parameter expansion to work:

TXTNM="${$1%.asc}"

this should result in name for the plaintext as message.txt

i think I've got it now:

TXTNM="${1%.*}"

but I can't see where I've gone wronglatest?d=yIl2AUoC8zA latest?i=XGjJZSwdtTA:zSoKhn38O2o:F7zBnMy latest?i=XGjJZSwdtTA:zSoKhn38O2o:V_sGLiP latest?d=qj6IDK7rITs latest?i=XGjJZSwdtTA:zSoKhn38O2o:gIN9vFwXGjJZSwdtTA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments