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.
我在带有终端和 Zsh 的 Mac OsX 下。我使用这个命令:
awk '/download/ {print $2}' | awk 'NR==1' | awk -F"//" '{print $2}'
有没有更好的方法可以只用一个 awk 编写所有 awk?
这应该是你所追求的:
$ awk '/download/{split($2,a,"//");print a[2];exit}' file