V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
luoer
V2EX  ›  编程

shell 脚本中 执行 php 脚本 如何让 shell 获取到 php 执行结果

  •  
  •   luoer · 2015-11-23 11:12:47 +08:00 · 4984 次点击
    这是一个创建于 3081 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如题,请各位指点一下。

    3 条回复    2015-11-23 11:24:12 +08:00
    fising
        1
    fising  
       2015-11-23 11:17:08 +08:00
    ``
    luoer
        2
    luoer  
    OP
       2015-11-23 11:22:00 +08:00
    @fising 谢谢!我试一下
    fising
        3
    fising  
       2015-11-23 11:24:12 +08:00
    output=`php demo.php`



    output=$(php demo.php)

    然后

    echo $output
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1605 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:34 · PVG 00:34 · LAX 09:34 · JFK 12:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.