Trace of executed programs called by a Bash script

后端 未结 8 1863
难免孤独
难免孤独 2020-12-13 14:44

A script is misbehaving. I need to know who calls that script, and who calls the calling script, and so on, only by modifying the misbehaving script.

This is similar

8条回答
  •  执念已碎
    2020-12-13 15:21

    adding pstree -p -u `whoami` >>output in your script will probably get you the information you need.

提交回复
热议问题