imn1
V2EX  ›  Bash

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

  •  
  •   imn1 · Oct 22, 2016 · 1813 views
    This topic created in 3585 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   ·   Solana   ·   5376 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 03:51 · PVG 11:51 · LAX 20:51 · JFK 23:51
    ♥ Do have faith in what you're doing.