Suppose I have a file which contains other file names with some extention [.dat,.sum etc].
text file containt
gdsds sd8ef g/f/temp_temp.sum
ghfp hrwer h/y/test.text.dat
if[-r h/y/somefile.dat] then....
I want to get the complete file names, like for above file I should get output as
temp_temp.sum
test.text.dat
somefile.dat
I am using AIX unix in which grep -ow [a-zA-Z_] filename is not working as for AIX -o switch is not present.
sed is good, but as you have a range of types of ‘records’, maybe awk can help.
My target is any ‘word’ found by awk that has a ‘/’ in it, then take that word, remove everything up to the last ‘/’, leaving just the filename.
output