Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
ysicing
V2EX  ›  Linux

请教 awk 中关于$$的用法

  •  1
     
  •   ysicing ·
    ysicing · Jun 17, 2019 · 2078 views
    This topic created in 2527 days ago, the information mentioned may be changed or developed.
    root@2ecb7fe6d0ad:~# cat a.txt
    1
    2 3
    4 a b
    a d zz w
    11 22s sc 1 3
    root@2ecb7fe6d0ad:~# awk '{print $$1}' a.txt
    1
    3
    
    a d zz w
    
    root@2ecb7fe6d0ad:~# awk '{print $$2}' a.txt
    1
    
    4 a b
    a d zz w
    
    

    这个是什么姿势,求教

    Supplement 1  ·  Jun 25, 2019

    具体解释可以参考 Indirect field addressing

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4844 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 985ms · UTC 09:51 · PVG 17:51 · LAX 02:51 · JFK 05:51
    ♥ Do have faith in what you're doing.