mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2025-08-22 03:43:16 +02:00
add to "variable" section
eval command to expand and execute variables
This commit is contained in:
@ -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)
|
||||||
|
Reference in New Issue
Block a user