Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
V2Yamato
V2EX  ›  Linux

bash shell 脚本中怎么用 logger 输出变量

  •  
  •   V2Yamato ·
    V-Yamato · Jun 14, 2017 · 3021 views
    This topic created in 3442 days ago, the information mentioned may be changed or developed.

    请问 logger 可以输出变量吗? 一般我的用法就是 logger "I'm going the run the if!" 输出到 syslog 但是我想要调试我的脚本 想把变量通过 logger 输出可以办到吗? 我直接写 logger "$var" 并不能行,跪求大神解答~~~~~~~~~~

    3 replies  •  2017-06-14 11:10:56 +08:00
    volqiu
    volqiu
    Jun 14, 2017
    1
    echo "$var" | logger
    V2Yamato
    V2Yamato
    OP
    Jun 14, 2017
    2
    @volqiu 卧槽!!万分感谢!!!!!!
    ytlm
    ytlm
    Jun 14, 2017
    3
    管道功能很强大啊
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2453 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 11:37 · PVG 19:37 · LAX 03:37 · JFK 06:37
    ♥ Do have faith in what you're doing.