This commit is contained in:
onceupon 2016-08-25 19:40:18 +08:00 committed by GitHub
parent bf4104af92
commit 965f7bb22d

View file

@ -112,6 +112,16 @@ grep -f fileA fileB
grep $'\t' 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 ##Sed
[[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)] [[back to top](#handy-bash-oneliner-commands-for-tsv-file-editing)]