Skip to content

Instantly share code, notes, and snippets.

@rothgar
Last active August 25, 2022 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rothgar/d8e7681d1509ae48b4b148f84e988d06 to your computer and use it in GitHub Desktop.
Save rothgar/d8e7681d1509ae48b4b148f84e988d06 to your computer and use it in GitHub Desktop.
curl-to-bash
# use pup for HTML parsing
# https://github.com/ericchiang/pup
#
# remove lines that start with < (html formatted)
# or # comments
curl-to-bash() {
curl -s "${1}" \
| pup -p code \
| grep -v -E '^[[:space:]]*#|^[[:space:]]*<'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment