mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-22 12:57:01 +00:00
add to "variable" section
eval command to expand and execute variables
This commit is contained in:
parent
0f1f62f507
commit
055bbc8790
@ -987,6 +987,14 @@ echo ${var,,}
|
|||||||
helloworld
|
helloworld
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
##### Expand and then execute variable/argument
|
||||||
|
```bash
|
||||||
|
cmd="bar=foo"
|
||||||
|
eval "$cmd"
|
||||||
|
echo "$bar" # foo
|
||||||
|
```
|
||||||
|
|
||||||
## Math
|
## Math
|
||||||
[[back to top](#handy-bash-one-liners)]
|
[[back to top](#handy-bash-one-liners)]
|
||||||
##### Arithmetic Expansion in Bash (Operators: +, -, *, /, %, etc)
|
##### Arithmetic Expansion in Bash (Operators: +, -, *, /, %, etc)
|
||||||
|
Loading…
Reference in New Issue
Block a user