Skip to content

Instantly share code, notes, and snippets.

@ward
Created April 4, 2010 00:48
Show Gist options
  • Select an option

  • Save ward/354977 to your computer and use it in GitHub Desktop.

Select an option

Save ward/354977 to your computer and use it in GitHub Desktop.
# 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))
@ward
Copy link
Author

ward commented Apr 4, 2010

$((line_ctr)) is used to evaluate the string n+n+n+n+n

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