News for hackers. Stuff that matters.
Re:Explain Shell by LostCharacter on Thursday March 30, 2017 @08:58AM (#13994923)
I have a little bash script I picked up somewhere that uses mankier.com to a similar effect:

  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."
      fi
  }

There are no comments on this comment yet.