Get the App
SLTechnology News&Howtos  ›  Servers  › 

() in the Shell of my Shell study notes

Shulou Source: shulou.com Published: 2022-06-02 19:08:28 10月02日 Update

IT technology is vast, with gradual learning, in order to do less repetitive learning, it is necessary to record bits and pieces of knowledge of self-study Shell.

Use () in shell:

The command is put into () (command), and the execution of the command is one-time and will not affect the current environment. # (command) opens a child SHELL. After the command is executed, the child SHELL ends its life, and the pid of this child SHELL is equal to the pid of the parent SHELL, and the variables defined by the parent SHELL can be used)

The execution of the command in {command 1; command 2;} will affect the current environment

When the command is put into () and the command is put into {}, multiple commands are executed as a whole, the difference is that () enabling sub-shell does not affect the current environment, {} does not enable sub-shell and will affect the current environment.

IT technology is vast, with gradual learning, in order to do less repetitive learning, it is necessary to record bits and pieces of knowledge of self-study Shell.

Tags: Commands learning environment impact piecemeal vast technology smoke knowledge Haoru one-off size variables multiple life whole guilds notes Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Microsoft Docker Shulou Information MySQL