I have file format like this (publishfile.txt)
drwxrwx---+  h655201 supergroup          0  2019-04-24  09:16  /data/xyz/invisible/se/raw_data/OMEGA
drwxrwx---+  h655201 supergroup          0  2019-04-24  09:16  /data/xyz/invisible/se/raw_data/sample
drwxrwx---+  h655201 supergroup          0  2019-04-24  09:16  /data/xyz/invisible/se/raw_data/sample(1)
I just want to extract the name OMEGA****, sample, sample(1) How can I do that I have used basename in my code but it doesn't work in for loop. Here is my sample code
for line in $(cat $BASE_PATH/publishfile.txt)
do 
      FILE_PATH=$(echo "line"| awk '{print  $NF}' )
done
FILE_NAME=($basename  $FILEPATH)
But this code also doesn't wor when used outside for loop
 
     
     
    