Created
April 4, 2010 00:48
-
-
Save ward/354977 to your computer and use it in GitHub Desktop.
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
| # Counts lines from all files in this directory and below it | |
| # Ignores hidden files (to make it include hidden files, change | |
| # the * wildcard to a . | |
| line_ctr=0; for file in `find * -type f`; do echo $file `cat $file | wc -l`; line_ctr=$line_ctr+`cat $file | wc -l`; done; echo $((line_ctr)) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$((line_ctr)) is used to evaluate the string n+n+n+n+n