Author: Bernd Storck Language: text
Description: Demo eienr Anwendung des Shellscripts "explain.sh". Timestamp: 2018-06-08 19:14:52 +0000
View raw paste Reply
  1. Man möchte ein komplexes Kommando erklärt bekommen, dies:
  2.  
  3. watch "ps -ef | grep -e '\<apache' -e '^UID\>' | grep -Ev '\<(grep|watch)\>'"
  4.  
  5. Dazu kann man explain um Auskunft angehen. So sehen Abfrage und Auskunft aus:
  6.  
  7.  $ explain "ps -ef | grep -e '\<apache' -e '^UID\>' | grep -Ev '\<(grep|watch)\>'"
  8. ps(1)
  9.   report a snapshot of the current processes.
  10.   -e (-E)
  11.     Select all processes. Identical to -A.
  12.  
  13.   -f (-F)
  14.     Do full-format listing. This option can be combined with many other UNIX-style options to add additional
  15.     columns. It also causes the command arguments to be printed. When used with -L, the NLWP (number of threads)
  16.     and LWP (thread ID) columns will be added. See the C option, the format keyword ARGS, and the format keyword
  17.     COMM.
  18.  
  19. ------------------------------------------------------------------------------------------------------------pipe--
  20.  
  21. grep(1)
  22.   print lines matching a pattern
  23.  
  24.   -e '^UID>' (-E PATTERN, --REGEXP=PATTERN)
  25.     Use PATTERN as the pattern. If this option is used multiple times or is combined with the -F (--FILE) option,
  26.     search for all patterns given. This option can be used to protect a pattern beginning with "-".
  27.  
  28. ------------------------------------------------------------------------------------------------------------pipe--
  29.  
  30. grep(1)
  31.   print lines matching a pattern
  32.  
  33.   -E (-E, --EXTENDED-REGEXP)
  34.     Interpret PATTERN as an extended regular expression (ERE, see below).
  35.  
  36.   -v (-V, --INVERT-MATCH)
  37.     Invert the sense of matching, to select non-matching lines.
  38.  
  39.   '\<(grep|watch)\>'
  40.  
  41.  
  42.  
  43.  
View raw paste Reply