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 wrong


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 wrong