如何在Unix / Linux控制台中使用firefox从文件打开URL地址?

时间:2018-07-21 01:57:53

标签: bash shell file url firefox

好吧,我有一个URL为“ file.txt”的文件,其中包含一个URL,我想使用firefox打开该URL。我尝试使用cat file.txt | firefox,但不起作用。 如果可以的话

1 个答案:

答案 0 :(得分:0)

cat file.txt | while read ; do firefox "$REPLY" ; done

在参数中传递网址。

或者您可以使用

firefox `cat file.txt`

作为更简单的版本。