Benutzer-Werkzeuge

Webseiten-Werkzeuge


edv:os:unix:shell:example:grep

grep

Es gibt unterschiedliche "grep"s, z.B.:

/usr/bin/grep
/usr/xpg4/bin/grep

Die 2. Variante hat Begrenzung des Eingabestrings auf 2048 Zeichen.

Beispiel:

# printf "%2047s" 1 | egrep -s 1; print $?
0
 
# printf "%2048s" 1 | egrep -s 1; print $?
1

Eine Fehlermeldung kommt leider nicht…

:!: NOTES

/usr/bin/grep
   Lines are limited only by the size of the available  virtual
   memory.  If  there  is a line with embedded nulls, grep will
   only match up to the first null;  if  it  matches,  it  will
   print the entire line.

/usr/xpg4/bin/grep

   The results are unspecified if  input  files  contain  lines
   longer  than LINE_MAX bytes or contain binary data. LINE_MAX
   is defined in /usr/include/limits.h.
grep LINE_MAX /usr/include/limits.h
#define _POSIX2_LINE_MAX                2048
#define LINE_MAX                _POSIX2_LINE_MAX

Stand: 22.10.2009

EOF

edv/os/unix/shell/example/grep.txt · Zuletzt geändert: 2020/01/11 01:23 von 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki