Files
tldr/pages.zh/common/eval.md
2024-01-01 15:56:36 +01:00

13 lines
323 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# eval
> 在当前 shell 中以单个命令的形式执行参数,并返回其结果。
> 更多信息:<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#eval>.
- 使用 'foo' 做为参数调用 `echo`
`eval "{{echo foo}}"`
- 在当前 shell 程序中设置变量:
`eval "{{foo=bar}}"`