mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-25 22:07:01 +00:00
fixed example for Variable command
This commit is contained in:
parent
7d40456576
commit
bab726081b
@ -188,9 +188,11 @@ echo ${var[@]#0}
|
|||||||
```bash
|
```bash
|
||||||
{var//a/,}
|
{var//a/,}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### Grep lines with strings from a file (e.g. lines with 'stringA or 'stringB' or 'stringC')
|
||||||
```bash
|
```bash
|
||||||
#with grep
|
#with grep
|
||||||
test="god the father"
|
test="stringA stringB stringC"
|
||||||
grep ${test// /\\\|} file.txt
|
grep ${test// /\\\|} file.txt
|
||||||
# turning the space into 'or' (\|) in grep
|
# turning the space into 'or' (\|) in grep
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user