Get extension of file
Asked by
hacktolive
Can anyone give me a way to get a file extension?
Assuming the filename is $FILENAME
I have this method:
> FILENAME=
> echo ${FILENAME#*.}
But is does not work if the file as no extension. (if gives just gives me the name of the file)
Thanks
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask hacktolive for more information if necessary.
To post a message you must log in.