Created
January 5, 2016 17:23
-
-
Save remy/eed1813e47473a7be5f4 to your computer and use it in GitHub Desktop.
Allows me to use `less <file>` or `less <url>`
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
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome!