How does Linux Shell switch the current work environment?

the "working environment" here refers to, for example, different namespaces or even interactive environments for different programs.
for example, after 1:Docker creates a container a, you can enter the interactive environment of a to perform the configuration of the container (such as configuring a virtual Nic), and then press ctrl+p+q to return to the previous work environment for other work. Can this type of task be completed automatically through the shell script?
example 2: run mininet, using shell and want the shell script to include mininet commands such as H1 ping H2.
if feasible, hope to get tutorials (or tutorial portals)
if not, hope to have an alternative, thank you.

Mar.18,2021

it is recommended to use the os in front of python3
clipboard.png
to execute the task in the host computer, and enter the bash, of docker through the subprocess sp pipe to execute the task in bash. This is the effect you want, isn't it? full automation

Menu