in my earlier post i showed extracting only dirname i mean remove the file name and print only dir path and this post is completely opposite, this post will extract only the file name.

#!/bin/sh
FILE_PATH=/a/b/c/test.py

FILE_NAME=$(basename $FILE_PATH)
echo $FILE_NAME

ubuntu@ubuntu:~/tmp$  ./test.sh
test.py
 
cool, it's printing only file name without using cut, sed and split....