Created
January 20, 2024 09:06
-
-
Save jkoppel/80f8b64a44b63b16db4c3cdd3392fe8f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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" | |
open "$URL" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment