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:
11
docs/kickstart/file/contains.md
Normal file
11
docs/kickstart/file/contains.md
Normal 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
|
||||
```
|
||||
|
11
docs/kickstart/stream/contains.md
Normal file
11
docs/kickstart/stream/contains.md
Normal 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
|
||||
```
|
||||
|
Reference in New Issue
Block a user