Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 仅从icecast live stream获取标题_Bash_Unix_Curl_Wget_Icecast - Fatal编程技术网

Bash 仅从icecast live stream获取标题

Bash 仅从icecast live stream获取标题,bash,unix,curl,wget,icecast,Bash,Unix,Curl,Wget,Icecast,我只想在bash中获取实时icecast流的头信息。我想使用这些信息 Content-Type: audio/ogg 采取某些行动 我已经尝试了curl和wget,但是icecast服务器不接受HEAD命令,因此我无法使用curl--HEAD或-I 我要做的是 curl -s -m 1 -D - -o /dev/null http://stream.radioreklama.bg:80/radio1_low.ogg | grep Content-Type ***仅使用来自icecast目录(

我只想在
bash
中获取实时icecast流的头信息。我想使用这些信息

Content-Type: audio/ogg
采取某些行动

我已经尝试了
curl
wget
,但是icecast服务器不接受HEAD命令,因此我无法使用
curl--HEAD
-I

我要做的是

curl -s -m 1 -D - -o /dev/null http://stream.radioreklama.bg:80/radio1_low.ogg | grep Content-Type
***仅使用来自icecast目录()的示例流

问题在于
-m1
,也就是说,它仍能获取1秒的内容。我不想要任何内容,只要抓取标题和结尾


非常感谢您的建议。

您的
grep
命令应该可以正常工作,您面临的问题是什么?向我们显示您需要的确切输出。
php-r“print\u r(get\u headers('http://stream.radioreklama.bg:80/radio1_low.ogg“
问题在于消除获取内容的需要。如何使用-m选项实现这一点?I.woild希望消除此命令造成的1秒延迟。@QuickPrototype:您已经只有1秒延迟,为什么要完全删除它?@QuickPrototype:检查我的更新,只需执行
curl-s-o/dev/null-w'{content\u type}''google.com'
您的
grep
命令就可以了,你面临的问题是什么?向我们显示您需要的确切输出。
php-r“print\u r(get\u headers('http://stream.radioreklama.bg:80/radio1_low.ogg“
问题在于消除获取内容的需要。如何使用-m选项实现这一点?I.woild希望消除此命令造成的1秒延迟。@QuickPrototype:您已经只有1秒延迟,为什么要将其全部删除?@QuickPrototype:检查我的更新,只需执行
curl-s-o/dev/null-w'%{content\u type}''google.com'