mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-22 12:57:01 +00:00
add variable replacement
This commit is contained in:
parent
4b1d481eb8
commit
2461aa5048
@ -1323,6 +1323,12 @@ e.g. replace all
|
|||||||
{i//a/,}
|
{i//a/,}
|
||||||
```
|
```
|
||||||
//for variable i, replace all 'a' with a comma
|
//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
|
##### Read user input
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user