当我打开终端时,我希望通过 bash 脚本自动执行以下命令。
newgrp docker
....
possible other commands
我希望通过 bash 脚本来完成此操作的原因是为了让我学习如何在打开终端时运行自动化。
伪代码:
Start
function
if terminal is running for the first time
execute commands
else if programs to be executed by commands are running already
don't run again
End
我尝试将命令添加newgrp docker
到 .bashrc 末尾,但它破坏了我的终端。