write eval

This commit is contained in:
Malin Freeborn 2024-04-07 11:52:24 +02:00
parent 72d624ec95
commit e0e403fc96
Signed by: andonome
GPG Key ID: 52295D2377F4D70F

22
basics/eval.md Normal file
View File

@ -0,0 +1,22 @@
---
title: "eval"
tags: [ "basics" ]
---
Compose a statement for execution.
```bash
x='echo $y'
echo $x
y=dragon
eval "$x"
```
The results remain in the current shell, unlike sub-shells.
```bash
b=basilisk
sh -c 'echo $b'
eval "g=goblin"
echo $g
```