Author: Bernd Storck Language: bash
Description: Beispielanwendung von "explain.sh". Timestamp: 2018-06-08 19:17:18 +0000
View raw paste Reply
Man möchte ein komplexes Kommando erklärt bekommen, dies:
 
watch "ps -ef | grep -e '\<apache' -e '^UID\>' | grep -Ev '\<(grep|watch)\>'"
 
Dazu kann man explain um Auskunft angehen. So sehen Abfrage und Auskunft aus:
 
$ explain "ps -ef | grep -e '\<apache' -e '^UID\>' | grep -Ev '\<(grep|watch)\>'"

ps(1)
  report a snapshot of the current processes.
  -e (-E)
    Select all processes. Identical to -A.
 
  -f (-F)
    Do full-format listing. This option can be combined with many other UNIX-style options to add additional
    columns. It also causes the command arguments to be printed. When used with -L, the NLWP (number of threads) and LWP (thread ID) columns will be added. See the C option, the format keyword ARGS, and the format keyword COMM.
 
------------------------------------------------------------------------------------------------------------pipe--
 
grep(1)
  print lines matching a pattern
 
  -e '^UID>' (-E PATTERN, --REGEXP=PATTERN)
    Use PATTERN as the pattern. If this option is used multiple times or is combined with the -F (--FILE) option, search for all patterns given. This option can be used to protect a pattern beginning with "-".
 
------------------------------------------------------------------------------------------------------------pipe--
 
grep(1)
  print lines matching a pattern
 
  -E (-E, --EXTENDED-REGEXP)
    Interpret PATTERN as an extended regular expression (ERE, see below).
 
  -v (-V, --INVERT-MATCH)
    Invert the sense of matching, to select non-matching lines.
 
  '\<(grep|watch)\>'
View raw paste Reply