Skip to content

Instantly share code, notes, and snippets.

@joshuatbrown
Created November 11, 2014 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuatbrown/83d895d03225916cdbed to your computer and use it in GitHub Desktop.
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
#!/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;
@joshuatbrown
Copy link
Author

Usage:
./toomanylines.sh Classes/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment