Here is an example of file path:
/isf/GCM/VPfig/Aas/AR/ClCo el Doma Republic/VMN CRTro.txt
What I want to get is the file basename:
VMN CRTro.txt
So I try the following:
echo /isf/GCM/VPfig/Aas/AR/ClCo el Doma Republic/VMN CRTro.txt | sed s'/\// /g' | awk '{print $NF}'
CRTro.txt <-- not as expected
Or
basename /isf/GCM/VPfig/Aas/AR/ClCo el Doma Republic/VMN CRTro.txt
basename: extra operand `Doma'
Try `basename --help' for more information. <-- basename cant handle spaces
What the best way to get the basename of a file with spaces in it?