Skip to content

Instantly share code, notes, and snippets.

@shawndumas
Last active December 27, 2015 18:49
Show Gist options
  • Save shawndumas/7372698 to your computer and use it in GitHub Desktop.
Save shawndumas/7372698 to your computer and use it in GitHub Desktop.
Explain
#!/bin/bash
#brew install gnu-sed
#ln -s /usr/local/bin/gsed /usr/local/bin/sed
URL=$(echo "http://explainshell.com/explain?cmd=$1+${@:2}" | sed -e 's/ /+/g')
curl -s "$URL" | sed -n '/<pre/,/<\/pre>/p' | sed -n '/<pre/,/<\/pre>/p' | sed -s 's/<[^>]*>//g' | \
sed -e 's/^ *//g;s/ *$//g' | grep '.' | cat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment