【问题标题】:grep on lynx commandlynx 命令上的 grep
【发布时间】:2016-10-13 07:48:10
【问题描述】:

我想在 lynx 命令上 grep 结果

lynx -head -dump http://abdsadsac.org

该命令的结果

Looking up 111.111.111.111:9004
Making HTTP connection to 111.111.111.111:9004
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://abdsadsac.org

我希望单词 replace 为 0 或向下,我尝试创建 bash 脚本,但该命令仍然显示。我想要的结果是。

#lynx -head -dump http://abdsadsac.org
Down

已经尝试在 bash 上使用 if else 但仍然不起作用。

【问题讨论】:

    标签: bash shell lynx


    【解决方案1】:

    如何使用退出代码来确定站点是否已启动?

    例如:

    $ lynx -head -dump http://abdsadsac.org 2> /dev/null || echo Down
    Down
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-23
      • 2015-07-12
      • 1970-01-01
      • 2016-12-24
      • 1970-01-01
      • 1970-01-01
      • 2016-04-22
      • 2011-01-17
      相关资源
      最近更新 更多