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 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)]