Introduce kickstart.stream.contains and kickstart.file.contains

The kickstart.stream.contains and kickstart.file.contains wraps the code
for checking for a string.
This commit is contained in:
Bruno Tavares
2014-02-27 14:55:29 -03:00
parent 3635cab96b
commit 56bf615b34
10 changed files with 37 additions and 8 deletions

View File

@ -0,0 +1,11 @@
# kickstart.file.contains file_name string_to_search
Searchs for `string_to_search` on `file_name`.
Returns 0 if there the file contains the string, and 1 otherwise.
### Example
```bash
$ kickstart.file.contains /etc/groups wheel && echo yup
$ kickstart.file.contains /etc/groups banana || echo nope
```

View File

@ -0,0 +1,11 @@
# kickstart.stream.contains string_to_search
Searchs for `string_to_search` on STDIN
Returns 0 if there the stream contains the string, and 1 otherwise.
### Example
```bash
$ echo weee | kickstart.stream.contains wee && echo yup
$ echo weee | kickstart.stream.contains ahh || echo nope
```