Extract filename from path in csh shell - from file list
How to extract the filename from the path; I have a list of files. I am using csh shell and install awk, sed, perl.
/ dfgfd / dfgdfg / filename
gotta give me
file name
I tried basename:
find $PROJDIR -name '*.c' -o -name '*.cc' -o -name '*.h'
| xargs grep -l pattern | xargs basename
and it gave me the following error:
basename: too few arguments Try `basename --help 'for more information.
THH
+2
source to share
4 answers