rfc
rfc is a little tool written in Bash to read RFCs from the
command-line. It fetches RFCs and drafts from the Web and caches them
locally.
Usage
Just type rfc followed by the RFC number or the draft name:
$ rfc <RFC num>
e.g.:
rfc 42 # Read the RFC 42
rfc 1234 # Read the RFC 1234
rfc draft-ietf-core-coap-18 # Read IETF draft core-coap version 18Use rfc help to see all available subcommands.
Options
--version: same as theversionsubcommand--help: same as thehelpsubcommand
Exit codes
0: normal execution1: the requested RFC or archive cannot be found2: unrecognized option/subcommand3: unable to connect to the network4: can't findcurlnorwget
Install
Basic install
mkdir -p ~/bin
curl -sL https://raw.github.com/bfontaine/rfc/master/rfc > ~/bin/rfc
chmod u+x ~/bin/rfcThis creates the ~/bin directory if it doesn’t exist, and download rfc in it.
If it’s not in your PATH, you have to add it:
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrcUsing Homebrew
If you use Homebrew or Linuxbrew you
can install rfc with one command:
brew install bfontaine/utils/rfc
Requirements
curlorwget. It’ll try$CURL, thencurl, thenwget.lessor another pager. It uses$PAGERif it’s set.
Customization
You can choose which directory rfc uses by setting the RFC_DIR environment
variable. The directory is automatically created if it doesn’t exist.
The default directory is ~/.RFCs.
Troubleshooting
rfc version 0.2.5 added a special --debug flag that, if passed as the first
argument, enables tracing of all the Bash commands in the script.
Credits
Baptiste Fontaine and contributors.
