How to extract filename and extension in bash shell script

[ec2-user@dockers ~]$ bash ~/test.sh
Full input file : /home/ec2-user/test.sh
Filename only : test.sh
File extension only: sh
First part of filename only, without extension: test

Comments