Skip to content

Instantly share code, notes, and snippets.

@axelson
Created August 30, 2013 00:04
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 axelson/6384869 to your computer and use it in GitHub Desktop.
Save axelson/6384869 to your computer and use it in GitHub Desktop.
Lookup shell on explain shell
# Lookup shell on explainshell
function explain() {
# Example url: http://explainshell.com/explain/tar?args=xzvf+archive.tar.gz
URL="http://explainshell.com/explain"
FIRST=0
for i; do
if [ $FIRST -eq 0 ]; then
URL="${URL}/$i?args="
FIRST=1
elif [ $FIRST -eq 1 ]; then
URL="${URL}${i}+"
fi
echo "arg: $i"
done
# Remove last +
URL="${URL%?}"
#echo "URL is $URL"
xdg-open "$URL"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment