This Worked.
file_name=`ls -ltr /dir1/dir2 | grep '^-' | tail -1 | awk '{print $9}' `
>>
I wouldn't use four external commands just the get a filename
>>
Is there an alternate to just get the latest file name from a dir?
I used grep to just get files from a dir or skip the dirs underneath it, tail -1 gives the latest file name. Awk just prints the name.
Thanks.