I have a variable FILE_NM in shell script which has "abc_xyz_mno_123" value in it. I want to get only "abc_xyz_mno" out of it in another variable. How to do it?
I tried :
NEW_NAME = $( echo $FILE_NM | rev | cut -d'_' -f2 | rev)
It gives me out put "xyz" only but i need entire name except last delimited value by '_'
Any suggestions?