fixed example for Variable command

This commit is contained in:
bonnie 2022-05-08 23:33:28 +08:00
parent 7d40456576
commit bab726081b

View File

@ -188,9 +188,11 @@ echo ${var[@]#0}
```bash
{var//a/,}
```
##### Grep lines with strings from a file (e.g. lines with 'stringA or 'stringB' or 'stringC')
```bash
#with grep
test="god the father"
test="stringA stringB stringC"
grep ${test// /\\\|} file.txt
# turning the space into 'or' (\|) in grep
```