Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

nickolasburr/rng

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

105 Commits
105 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rng

rng streams input from a file or stdin to stdout.

It is the love child of sed -n '<START>,<END>p' and tail -n.

You can install rng via Homebrew or manually.

brew tap nickolasburr/pfa
brew install rng
git clone https://github.com/nickolasburr/rng.git
cd rng
make
make install

By default, files are installed to /usr/local You can install elsewhere by passing PREFIX to make install.

make install PREFIX=/opt

Certain range values can be omitted if they can be properly implied. To get multiple ranges, use the colon (:) operator.

Get lines 7-15 in Makefile.

rng 7,15 Makefile

Skip the first 4 lines of input from a pipe.

echo -e "First\nSecond\nThird\nFourth\nFifth" | rng 5

Output lines 1-25 in Makefile.

rng ,25 Makefile

Get lines 5-10 and 17-22 in main.c.

rng 5,10:17,22 main.c

Output all lines except 11-19 in main.c

rng ,10:20, main.c

Get lines 16-27 of a text document from the web.

curl -fsL https://www.w3.org/TR/2003/REC-PNG-20031110/iso_8859-1.txt | rng 16,27

About

Print range of lines to stdout.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.