2
0
Fork 0
mirror of https://github.com/onceupon/Bash-Oneliner synced 2025-03-08 17:17:18 +00:00

add variable replacement

This commit is contained in:
onceupon 2017-10-27 11:13:54 +08:00 committed by GitHub
parent 4b1d481eb8
commit 2461aa5048

View file

@ -1323,6 +1323,12 @@ e.g. replace all
{i//a/,}
```
//for variable i, replace all 'a' with a comma
e.g. with grep
```bash
test="god the father"
grep ${test// /\\\|} file.txt
#turning the space into 'or' (\|) in grep
```
##### Read user input