cut the last column from the link

Hi,

I need to cut the last of below link

lrwxrwxrwx 1 e027025 denccefs 36 Oct 21 02:30 prodcode1 -> /efare1/LINUXMTP-4/HOTFIX111019A_5U4/

after cut I need this value HOTFIX111019A_5U4

Please help me.

Thanks

$ ls -ltr prodcode1 | awk -F/ '{print $(NF-1)}'

Hi

When I try the above coomand thrugh script is gives me wrong value

 
#!/bin/bash
#################################################################################################
#The below command will Fetch the latest tag from SPLASH Repository and put it into the         #
#FetchCode.config                                                                               #
#                                                                                               #
#                                                                                               #
#################################################################################################
cd /efare1/dist/src
ls -ltr prodcode1 | awk -F/ '{print $(NF-1)}'>/usr/local/adm/rohit/FetchCode.config

and it gives me LINUXMTP-4 in FetchCode.config file.

Go ahead and try with this ..

ls -ltr prodcode1 | awk -F/ '{print $NF}'>/usr/local/adm/rohit/FetchCode.config