Full command line as it was typed

后端 未结 8 2089
猫巷女王i
猫巷女王i 2020-12-01 20:56

I want to get the full command line as it was typed.

This:

\" \".join(sys.argv[:])

doesn\'t work here (deletes double quotes). Also I pr

8条回答
  •  盖世英雄少女心
    2020-12-01 21:20

    As mentioned, this probably cannot be done, at least not reliably. In a few cases, you might be able to find a history file for the shell (e.g. - "bash", but not "tcsh") and get the user's typing from that. I don't know how much, if any, control you have over the user's environment.

提交回复
热议问题