Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
事情是我wget用来提取 url 之后我想将它通过管道传输到 grep 以检查它是否匹配某些模式以及它是否只是回显 url 的名称。
wget
像这样的东西:
wget url |grep "pattern" if successful display urlname
如果if命令返回 0,则条件为真。如果grep模式与输入匹配,则返回 0。
if
grep
if wget -O - ... | grep -q ... then ... fi