Grep variables with space within it

Grep variables with space within it
This commit is contained in:
onceupon 2017-10-26 16:20:59 +08:00 committed by GitHub
parent afc0010830
commit 1dece9ec82

View File

@ -39,6 +39,13 @@ grep -o -P '(?<=w1).*(?=w2)'
grep -v bbo filename
```
##### Grep variables with space within it (e.g. bbo="some strings")
```bash
grep "$boo" filename
```
#remember to quote the variable!
##### Grep only one/first match (e.g. bbo)
```bash