Created
November 11, 2014 14:55
-
-
Save joshuatbrown/83d895d03225916cdbed to your computer and use it in GitHub Desktop.
Print the number of lines for any file that's over 400 lines
This file contains 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
#!/bin/bash | |
for file in $*; do | |
if [ -d $file ] | |
then | |
echo "it's a directory" | |
else | |
count=`wc -l < $file` | |
if [ $count -gt 400 ] | |
then | |
echo "$count $file" | |
fi | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
./toomanylines.sh Classes/*