mirror of
https://github.com/tldr-pages/tldr.git
synced 2026-08-28 11:25:16 +08:00
emulate: add page (#22278)
Co-authored-by: Dylan <145150333+dmmqz@users.noreply.github.com> Co-authored-by: Ivan Baluta <ivanbaluta.dev@gmail.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# emulate
|
||||
|
||||
> Reset shell options to match a certain shell's behavior.
|
||||
> Also used to ensure a shell function runs with the default configuration.
|
||||
> More information: <https://github.com/antonio/zsh-config/blob/master/help/emulate>.
|
||||
|
||||
- Print current emulation mode:
|
||||
|
||||
`emulate`
|
||||
|
||||
- Adjust settings of the current shell session to mimic Bash:
|
||||
|
||||
`emulate bash`
|
||||
|
||||
- Evaluate a [c]ommand within temporary emulation:
|
||||
|
||||
`emulate ksh -c "{{echo hi}}"`
|
||||
|
||||
- Emulate the default Zsh, [R]esetting options when possible:
|
||||
|
||||
`emulate zsh -R`
|
||||
|
||||
- Scope emulation to the current function:
|
||||
|
||||
`{{my_function}}() { emulate -L {{zsh|sh|ksh|csh}}; {{ls}} }`
|
||||
Reference in New Issue
Block a user