Last active
April 25, 2018 15:40
-
-
Save freshyill/ec935fdcd8524e2b1f249035dbae57d5 to your computer and use it in GitHub Desktop.
Count lines in a directory of files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| COUNTER=0; | |
| for files in *; | |
| do | |
| if test -f "$files"; then | |
| LINES=`wc -l $files | awk '{print $1}'` | |
| fi | |
| COUNTER=`expr $COUNTER + $LINES`; | |
| done | |
| echo $COUNTER; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment