3 ms·
Any reason why this is stuck in browser? I've got most oif the raw data (man pages) already on my machine and the closer this is tied to command line the more
by Toenex 13y ago
Any reason why this is stuck in browser? I've got most oif the raw data (man pages) already on my machine and the closer this is tied to command line the more likely I am to use it. For instance I'd love to be able to do;
explain !!
in my shell to work out what just happened!;)
Good work by the way.
- jbackus 13y agoThis should work: #!/bin/bash cmd="$(cut -d ' ' -f 1 <<< "$@" )"; args="$(cut -d ' ' -f 2- <<< "$@" )"; url="http://explainshell.com/explain/$cmd?args=$args" explanation="$(curl -s $url | grep '<pre' | sed -E 's/<\/?[a-z]+(\ [a-z]+=\"[a-z0-9]+\")*>//g' | sed -E 's/^\ +//g')" echo "$explanation" Example: ~$ tar xzvf archive.tar.gz ~$ explain !! explain tar xzvf archive.tar.gz The GNU version of the tar archiving utility -x, --extract, --get -z, --gzip, --gunzip --ungzip -v, --verbose -f, --file ARCHIVE Save in /usr/local/bin. Gist: https://gist.github.com/backus/6387485 https://gist.github.com/backus/6387485
- Toenex 13y agoBeautiful. Thank you.