mirror of
https://github.com/onceupon/Bash-Oneliner
synced 2024-11-26 06:30:17 +00:00
add to "variable" section
eval command to expand and execute variables
This commit is contained in:
parent
0f1f62f507
commit
055bbc8790
1 changed files with 8 additions and 0 deletions
|
@ -987,6 +987,14 @@ echo ${var,,}
|
|||
helloworld
|
||||
```
|
||||
|
||||
|
||||
##### Expand and then execute variable/argument
|
||||
```bash
|
||||
cmd="bar=foo"
|
||||
eval "$cmd"
|
||||
echo "$bar" # foo
|
||||
```
|
||||
|
||||
## Math
|
||||
[[back to top](#handy-bash-one-liners)]
|
||||
##### Arithmetic Expansion in Bash (Operators: +, -, *, /, %, etc)
|
||||
|
|
Loading…
Reference in a new issue