Skip to content

Instantly share code, notes, and snippets.

@remy
Created January 5, 2016 17:23
Show Gist options
  • Save remy/eed1813e47473a7be5f4 to your computer and use it in GitHub Desktop.
Save remy/eed1813e47473a7be5f4 to your computer and use it in GitHub Desktop.
Allows me to use `less <file>` or `less <url>`
function less() {
url="$_"
if [[ $url == http* ]]; then
args=( "$@" )
unset "args[${#args[@]}]" # remove the last element
lynx --dump $url | command less $args
else
command less $@
fi
}
@TheZ3ro
Copy link

TheZ3ro commented Jan 5, 2016

Awesome!

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