grep
Description:
[ CCode ( array_length = false , array_null_terminated = true ) ]
[ Version ( since = "1.0.66" ) ]
public string[] grep (string regex, string path, Grep? optargs) throws Error
[ Version ( since = "1.0.66" ) ]
public string[] grep (string regex, string path, Grep? optargs) throws Error
return lines matching a pattern
This calls the external grep
program and returns the matching lines.
The optional flags are:
extended
Use extended regular expressions. This is the same as using the *-E* flag.
fixed
Match fixed (don't use regular expressions). This is the same as using the *-F* flag.
insensitive
Match case-insensitive. This is the same as using the *-i* flag.
compressed
Use zgrep
instead of grep
. This allows the input to be compress- or gzip-compressed.
Parameters:
this |
A GuestfsSession object |
optargs |
a GuestfsGrep containing optional arguments |
Returns:
an array of returned strings, or NULL on error |