当前位置:网站首页>awk从入门到入土(17)awk多行写法
awk从入门到入土(17)awk多行写法
2022-07-24 17:28:00 【奇妙之二进制】
当awk的脚本比较复杂,导致一行写不下或者你想格式优美一些时,可以采用多行写法。
1、一条语句战一行,直接回车即可
[email protected]:~$ ls -l | awk '{ > print 1 > }'
awk识别到’时会自动结束。
2、一条独立的语句,需要折行,必须借助\,否则会被识别成两条独立语句。
[email protected]:~$ ls -l | awk '{ print \ > 1 > }'
上面的print 如果不加,print和1就会被拆分成两条语句。
3、#后面的内容会被识别成注释,导致\不生效
gawk 'BEGIN { print "dont panic" # a friendly \ > BEGIN rule >}'
错误→ gawk:cmd。line:2: BEGIN 规则
错误→ gawk:cmd。line:2: ^ 语法错误
边栏推荐
- 还在用Xshell?你out了,推荐一个更现代的终端连接工具!
- The results of the second quarter online moving people selection of "China Internet · moving 2022" were announced
- Js实现继承的六种方式
- 一个实际使用SwiftUI 4.0中ViewThatFits自适应视图的例子
- Atcoder Beginner 202 E - Count Descendants(离线查询 重链剖分树上启发式合并)
- Opencv has its own color operation
- 滚动条调整亮度和对比度
- JSP custom tag library --foreach
- Pat a - correct spelling
- DBF menu driver: librarydatabaseproject
猜你喜欢

Heuristic merging (including examples of general formula and tree heuristic merging)

使用matplotlib模拟线性回归

2022 Yangtze River Delta industrial automation exhibition will be held in Nanjing International Exhibition Center in October

安全:如何为行人提供更多保护

Analyze the capabilities and scenarios of Apache pulsar, a cloud native message flow system
![Why can't sizeof (ARR) / size (arr[0]) be used to calculate the array length inside the called function?](/img/e6/1d2213f3eb9bd0ff537a66d2b01f98.png)
Why can't sizeof (ARR) / size (arr[0]) be used to calculate the array length inside the called function?

How the computer accesses the Internet (IV) LAN and server response

Portfwd port forwarding

内核开发

Mobile robot (IV) four axis aircraft
随机推荐
内核开发
Programming language exercises (I)
Coldplay weekly issue 10
量化框架backtrader之一文读懂Indicator指标
DHCP relay of HCNP Routing & Switching
Iftnews | Christie's launched its venture capital department, aiming at Web3 and metauniverse industries
Code random notes_ Linked list_ 707 design linked list
Preliminary understanding of redis
Exception handling - a small case that takes you to solve NullPointerException
NPM install reported -4058 error
Mobile robot (IV) four axis aircraft
Shardingsphere database read / write separation
Keyboard input operation
Canvas from getting started to persuading friends to give up (graphic version)
Still shocked by the explosion in the movie? Then you must not miss this explosive plug-in of unity
一个实际使用SwiftUI 4.0中ViewThatFits自适应视图的例子
portfwd 端口转发
Baidu PaddlePaddle easydl x wesken: see how to install the "eye of AI" in bearing quality inspection
Getaverse,走向Web3的远方桥梁
Ipaylinks, a cross-border payment integration service, won the 3A Asia Award of treasury