mirror of
https://github.com/onceupon/Bash-Oneliner
synced 2024-11-22 20:54:19 +00:00
add grep
This commit is contained in:
parent
bf4104af92
commit
965f7bb22d
1 changed files with 10 additions and 0 deletions
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 a new issue