mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-12-23 08:46:36 +00:00
add grep
This commit is contained in:
parent
bf4104af92
commit
965f7bb22d
10
README.md
10
README.md
@ -112,6 +112,16 @@ grep -f fileA fileB
|
||||
grep $'\t'
|
||||
```
|
||||
|
||||
#####grep variable from variable
|
||||
```bash
|
||||
$echo "$long_str"|grep -q "$short_str"
|
||||
if [ $? -eq 0 ]; then echo 'found'; fi
|
||||
```
|
||||
//grep -q will output 0 if match found
|
||||
//remember to add space between []!
|
||||
|
||||
|
||||
|
||||
##Sed
|
||||
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user