This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.
Explainshell I stumbled into this brilliant tidbit in a post by LostCharacter on ycombinator. Here’s the actual code: explain () { if [ '$#' -eq 0 ] then while read -p 'Command: ' cmd do curl -Gs 'https://www.mankier.com/api/explain/?cols='$(tput cols) --data-urlencode 'q=$cmd' done echo 'Bye!' elif [ '$#' -eq 1 ] then curl -Gs 'https://www.mankier.com/api/explain/?cols='$(tput cols)…
Explainshell I stumbled into this brilliant tidbit in a post by LostCharacter on ycombinator.
Here’s the actual code:
explain () { if [ "$#" -eq 0 ] then while read -p "Command: " cmd do curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$cmd" done echo "Bye!" elif [ "$#" -eq 1 ] then curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$1" else echo "Usage" echo "explain interactive mode." echo "explain 'cmd -o | ...' one quoted command to explain it.Read on /posts/2019/07/explain-in-the-membrane/ ↗
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.