Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #Dintr-o lista de fisiere, sa se afiseze numele celui cu nr max de cuvinte si nr
  4.  
  5. maxWords=-1;
  6. name='nameless';
  7.  
  8. echo "Dati numarul de fisiere: "
  9. read n
  10.  
  11. for i in `seq 1 $n`;
  12. do
  13. read fileName
  14. read nrW <<<$(awk -f temalab4.awk $fileName)
  15. if [ nrW > maxWords ]
  16. then
  17. maxWords=$nrW
  18. name=$fileName
  19. fi
  20. done
  21.  
  22. echo "$maxWords"
  23. echo "$name"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement