当前位置:网站首页>Awk from getting started to getting into the ground (3) the built-in functions printf and print of awk realize formatted printing
Awk from getting started to getting into the ground (3) the built-in functions printf and print of awk realize formatted printing
2022-07-03 02:14:00 【Wonderful binary】
awk in print And printf The main differences are shown in the following two points :
- print When displaying multiple results, separate them with commas , As a result, the contents of these parts will automatically use the output separator ( The default field output delimiter is a space , The record output delimiter defaults to line feed ) separation , And there is no need to add line breaks \n; If not used , interval , Will be connected when printing , Even if spaces are used :
[email protected]:~$ awk -F: 'BEGIN{k=1} {print $1,$2}' /etc/passwd
root x
daemon x
bin x
sys x
[email protected]:~$ awk -F: 'BEGIN{k=1} {print $1 $2}' /etc/passwd
rootx
daemonx
binx
sysx
syncx
gamesx
- printf You can control the output format of a field more flexibly , By using %-12s,%3.1f Equal formatting method .printf Closer to using C The habits of language students .
$ awk -F: 'BEGIN{k=1} {printf "%s,%s边栏推荐
- String replace space
- 【Camera专题】Camera dtsi 完全解析
- Reprint some Qt development experience written by great Xia 6.5
- What are the key points often asked in the redis interview
- 4. 类和对象
- Return a tree structure data
- Distributed transaction solution
- Socket programming
- 力扣(LeetCode)183. 从不订购的客户(2022.07.02)
- leetcode961. Find the elements repeated N times in the array with length 2n
猜你喜欢

全链路数字化转型下,零售企业如何打开第二增长曲线

How can retail enterprises open the second growth curve under the full link digital transformation

MySQL learning 03

SPI机制
![[fluent] fluent debugging (debug debugging window | viewing mobile phone log information | setting normal breakpoints | setting expression breakpoints)](/img/ac/bf83f319ea787c5abd7ac3fabc9ede.jpg)
[fluent] fluent debugging (debug debugging window | viewing mobile phone log information | setting normal breakpoints | setting expression breakpoints)
![[shutter] shutter debugging (debugging fallback function | debug method of viewing variables in debugging | console information)](/img/66/0fda43da0d36fc0c9277ca86ece252.jpg)
[shutter] shutter debugging (debugging fallback function | debug method of viewing variables in debugging | console information)

y54.第三章 Kubernetes从入门到精通 -- ingress(二七)

詳細些介紹如何通過MQTT協議和華為雲物聯網進行通信

8 free, HD, copyright free video material download websites are recommended

Comment communiquer avec Huawei Cloud IOT via le Protocole mqtt
随机推荐
深度(穿透)选择器 ::v-deep/deep/及 > > >
DQL basic operation
SPI mechanism
[shutter] hero animation (hero realizes radial animation | hero component createrecttween setting)
Kotlin middle process understanding and Practice (I)
The sandbox explains its vision for the meta universe platform
Explore the conversion between PX pixels and Pt pounds, mm and MM
Answers to ten questions about automated testing software testers must see
[Yu Yue education] reference materials of chemical experiment safety knowledge of University of science and technology of China
In the face of difficult SQL requirements, HQL is not afraid
How do it students find short-term internships? Which is better, short-term internship or long-term internship?
Trial setup and use of idea GoLand development tool
iptables 4层转发
The testing process that software testers should know
What are the key points often asked in the redis interview
CFdiv2-Fixed Point Guessing-(区间答案二分)
Detailed introduction to the deployment and usage of the Nacos registry
Introduce in detail how to communicate with Huawei cloud IOT through mqtt protocol
[camera special topic] Hal layer - brief analysis of addchannel and startchannel
Solution for processing overtime orders (Overtime unpaid)