Created
February 14, 2014 18:43
-
-
Save jballanc/9006572 to your computer and use it in GitHub Desktop.
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
> cat sample.txt | |
first | |
second | |
start | |
third | |
fourth | |
fifth | |
sixth | |
stop | |
seventh | |
eigth | |
ninth | |
tenth | |
> ruby -ne "BEGIN { i = 0 } ; i += 1 if /start/../stop/ ; END { puts \"There were #{i} lines between 'start' and 'stop'\" }" < sample.txt | |
There were 6 lines between 'start' and 'stop' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment