prePEND消息rsstail [英] Prepend message to rsstail

查看:126
本文介绍了prePEND消息rsstail的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图prePEND一条消息rsstail的输出,这就是我现在:

  rsstail -o -i 15 --initial 0 http://feeds.bbci.co.uk/news/world/europe/rss.xml | AWK -v时间= $(日期+ \\ [%H:%M:%S_%D /%M /%Y \\])'{打印时间,$ 0}'|三通someFile.txt

这应该给我以下内容:

  [23:46:49_23 /二千零十四分之十]标题:someTitle

命令后,我有一个 |而读线做...结束永远也不会被调用,因为上面的命令没有输出一个单一的东西。我在做什么错了?

PS:我使用的rsstail的Python版本,因为另外一个劲儿地崩溃(的https:/ /github.com/gvalkov/rsstail.py

编辑:

由于在评论中要求的命令:

  rsstail -o -i 15 --initial 0 http://feeds.bbci.co.uk/news/world/europe/rss.xml

会给回这样的消息下,当一个新的文章中找到

 标题:瑞典要求关闭搜索子


解决方案

看来,我的 rsstail 和你不一样,但我支持选项

  -Z加上x标题X

  rsstail -Z$(日期+ \\ [%H:%M:%S_%D /%M /%Y \\])...

做工作,而不 AWK ;在另一方面,你确实有一些问题,缓冲,这可能要问 rsstail 标题给定数目后停止?

I am trying to prepend a message to the output of rsstail, this is what I have right now:

rsstail -o -i 15 --initial 0 http://feeds.bbci.co.uk/news/world/europe/rss.xml | awk -v time=$( date +\[%H:%M:%S_%d/%m/%Y\] ) '{print time,$0}' | tee someFile.txt

which should give me the following:

[23:46:49_23/10/2014] Title: someTitle

After the command I have a | while read line do ... end which never gets called because the above command does not output a single thing. What am I doing wrong?

PS: I am using the python version of rsstail, since the other one kept on crashing (https://github.com/gvalkov/rsstail.py)

EDIT:

As requested in the comments the command:

rsstail -o -i 15 --initial 0 http://feeds.bbci.co.uk/news/world/europe/rss.xml

Will give back a message like the following when a new article is found

Title: Sweden calls off search for sub

解决方案

It seems that my rsstail is different from yours, but mine supports the option

-Z x    add heading 'x'

so that

rsstail -Z"$( date +\[%H:%M:%S_%d/%m/%Y\] ) " ...

does the job without awk; on the other hand, you do have some problem with buffering, is it possible to ask rsstail to stop after a given number of titles?

这篇关于prePEND消息rsstail的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆