Questions tagged «awk»

awk是一种专用的解释型编程语言,用于提取和报告数据。

1
为什么使用双引号将awk的动作语句括起来与使用单引号将它们括起来相比会产生不同的结果?
如果我使用单引号将awk的action语句括起来,它将按预期工作: $ dpkg -l | grep "linux\-[a-z]*\-" | awk {'print $2'} linux-headers-3.13.0-27 linux-headers-3.13.0-27-generic linux-headers-3.14.4-031404 linux-headers-3.14.4-031404-generic linux-headers-generic linux-image-3.13.0-27-generic linux-image-3.14.4-031404-generic linux-image-extra-3.13.0-27-generic linux-image-generic linux-libc-dev:i386 linux-sound-base 但是,如果我使用双引号将其引起来,它将打印整行而不是特定的列/字段: $ dpkg -l | grep "linux\-[a-z]*\-" | awk {"print $2"} ii linux-headers-3.13.0-27 3.13.0-27.50 all Header files related to Linux kernel version 3.13.0 ii linux-headers-3.13.0-27-generic 3.13.0-27.50 i386 Linux …

1
Bash,awk,将2个cols除以,然后比较“
系统 Linux local 5.0.0-27-lowlatency #28-Ubuntu SMP PREEMPT Tue Aug 20 20:33:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux 题 我该如何比较,字段中"何时,存在的两个cols除以和字段(带的经典csv ")。 输入文件。 Titulka,231096,Spárovka borová 18 x 200 x 600 mm,https://eshop.unihobby.cz/stavba-drevo-a-wpc-sparovky-sparovka-borova-18x200x600mm/144020p/?utm_source=kupi&utm_medium=letak&utm_campaign=9_2019,https://eshop.unihobby.cz/bin/product/4/231096-sp-rovka-borov-1-pou-t-tuto.jpg,42,45 Titulka,345602,"Lak Aquafin Plus čirý lesklý 0,6 kg",https://eshop.unihobby.cz/bydleni-barvy-a-laky-laky-a-lazury-lak-aquafin-plus-ciry-leskly-0-6-kg/153252p/?utm_source=kupi&utm_medium=letak&utm_campaign=9_2019,https://eshop.unihobby.cz/bin/product/4/345602-aquafin-plus-plechovka.jpg,179,199 Titulka,345588,"Lak Movi Pur OSB čirý lesklý 0,6 kg",https://eshop.unihobby.cz/bydleni-barvy-a-laky-laky-a-lazury-lak-movi-pur-osb-ciry-leskly-0-6-kg/150470p/?utm_source=kupi&utm_medium=letak&utm_campaign=9_2019,https://eshop.unihobby.cz/bin/product/4/345588.jpg,209,229 Titulka,213993,Schodnice masiv 300x1000x40 mm - smrk,https://eshop.unihobby.cz/stavba-schodiste-a-zabradli-schodnice-schodnice-masiv-300x1000x40-mm-smrk/138451p/?utm_source=kupi&utm_medium=letak&utm_campaign=9_2019,https://eshop.unihobby.cz/bin/product/4/213993-schodnice-masiv-300x1000x40-smrk.jpg,299,329 …
1 bash  awk 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.