0

I have an Awk script that counts the average of rows from every file from a given directory and its subdirectories and I have to print the filename and the average from a file like this

example.c : 5

So I have filenames like this ../labor1/munka/hazik_pagi4188/hazik/c_prog/lab1/fork2.c and I want to get like this fork2.c (I have different length file names with path).

AdminBee
  • 22,803

1 Answers1

0

Try "recursive" grep and remove the path with sed, like

grep -rc "." | sed 's#^.*/##'
madsum.awk:11
zmz.awk:14
file_to_process.txt:2
RudiC
  • 8,969