Change working directory in shell with a python script

前端 未结 5 1309
遇见更好的自我
遇见更好的自我 2020-12-06 01:16

I want to implement a userland command that will take one of its arguments (path) and change the directory to that dir. After the program completion I would like the shell t

5条回答
  •  攒了一身酷
    2020-12-06 01:34

    That is not going to be possible.

    Your script runs in a sub-shell spawned by the parent shell where the command was issued.

    Any cding done in the sub-shell does not affect the parent shell.

提交回复
热议问题