Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kdm9/hail
Hail: extract lines from a file, a la `head -n x | tail -n y`
https://github.com/kdm9/hail
Last synced: 19 days ago
JSON representation
Hail: extract lines from a file, a la `head -n x | tail -n y`
- Host: GitHub
- URL: https://github.com/kdm9/hail
- Owner: kdm9
- Created: 2015-02-13T12:34:55.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-09-03T09:18:50.000Z (about 4 years ago)
- Last Synced: 2024-10-11T19:23:32.074Z (about 1 month ago)
- Language: C
- Size: 12.7 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
hail
====Extract lines from a file
Installation
------------Hail has no dependencies other than a C compiler which implements the GNU-C99
standard. To install:git clone https://github.com/kdmurray91/hail.git
cd hail
make
make installAbout
-----Hail gets its name from a contraction of `head` and `tail`, the common
alternative to this program. It extracts lines from a file, taken on stdin,
and prints them on stdout. It's so simple that the Unix wizards of old never
bothered. But I'm lazy and prone to procrastination.Hail takes any number of `x`-`y` pairings as arguments. These pairs are
integral numbers, corresponding to the first and last lines to print. The
final number may be excluded to indicate that the remainder of the file
should be printedExamples
--------# prints 1 through 10, i.e. does nothing
seq 1 10 | hail 1-# prints 1 through 3, i.e. equivalent to `head -n 3`
seq 1 10 | hail 1-3# prints 3 through 5, i.e. equivalent to `head -n 5 | tail -n 3`
seq 1 10 | hail 3-5# prints 5 through 10, i.e. equivalent to `tail -n 6`
seq 1 10 | hail 5-# prints 2, 3, 5 and 7, which is where I'll give up on my comparisons to
# head and tail
seq 1 10 | hail 2-3 5-5 7-7License
-------Copyright 2015 Kevin Murray
Licensed under the GNU General Public License, version 3 or (at your option)
any later version.