mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-26 06:17:01 +00:00
Grep variables with space within it
Grep variables with space within it
This commit is contained in:
parent
afc0010830
commit
1dece9ec82
@ -39,6 +39,13 @@ grep -o -P '(?<=w1).*(?=w2)'
|
|||||||
grep -v bbo filename
|
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)
|
##### Grep only one/first match (e.g. bbo)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
Loading…
Reference in New Issue
Block a user