linux - Lynx的自动化

标签 linux bash shell automation

我想为研究建立一个自定义的词表,因此我要抓取特殊的网站。 我想要: 通过此命令从命令行使用 Lynx:

lynx -dump -listonly "example.com" | grep -E -o "http://example.com.*|http://www.example.com.*" | sort | uniq > output.txt

我不想写 5000 x 这个命令。我想使用带有网站的 .txt 文件,该文件将由 lynx 命令读取,所有“输出”都应放在一个文件中。 你能帮我解决这个问题吗?我是 Linux/Ubuntu 的菜鸟,对编​​码一无所知。对不起我的语言,我是德语。

最佳答案

你的意思是像

cat yourdomains.txt | while read domain
do
    lynx -dump -listonly "$domain" | \
       grep -E -o "http://${domain}.*|http://www.${domain}.*" 
done | sort | uniq > output.txt

?

关于linux - Lynx的自动化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37610797/

相关文章:

c++ - 如何正确接收来自管道的数据?

linux - 如何映射由 get_user_pages_fast 固定的页面以将它们用作驱动程序中的虚拟连续缓冲区?

linux - 如何在构建 Linux 内核的同时构建用户级程序

python - 设置环境变量,使其可以在我的程序之外读取

php - user@host 和 sh-4.1$ 之间的区别(使用 GNU 屏幕)

bash - 下载视频时获取 youtube 视频标题

linux - 如何根据文件中的最少行数删除前 X 行

mysql - mySQL 脚本中的语法错误?

bash shell 脚本 for 循环中的两个变量

shell - 像快速失败测试一样运行 SICP Scheme 文件