imn1
V2EX  ›  Bash

bash 脚本能否捕获哪个调用它

  •  
  •   imn1 · Oct 22, 2016 · 1838 views
    This topic created in 3604 days ago, the information mentioned may be changed or developed.
    echo $0 只能显示自己

    例如
    A.sh
    -----------
    #!/bin/bash
    B.sh
    -----------

    B.sh 中能否知道是 A.sh 调用?
    1 replies    2016-10-22 13:56:56 +08:00
    xzl380
        1
    xzl380  
       Oct 22, 2016
    echo $PPID
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   968 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:20 · PVG 03:20 · LAX 12:20 · JFK 15:20
    ♥ Do have faith in what you're doing.