I am trying to find the number of certain types of files that have a '_' in the filename.
I'm a massive beginner so my syntax looks like this at the moment;
foreach txt ( 'ls *.txt')
set n=0
if(grep _ txt) then
@ n = n+1
endif
end
It doesn't work as my if statement isn't correct, but I'm not sure how to define saying if the txt file has a '_' within the filename then increment n by 1.
_in them, or for each file, how many_it has? – Mat Feb 25 '12 at 13:06_, or the number of_in each filename? – Mat Feb 25 '12 at 13:28