awk data type, is not required to define, adaptive. Sometimes you need to cast. We can do this by the following operations.
1, awk string to number
[chengmo@centos5 ~]$ awk 'BEGIN{a="100";b="10test10"; Print (a+b+0);}' 110
You only need to connect the variables through the ”+” connection. Automatically force a string to be an integer. The non-numeric becomes 0, and the first non-numeric character is found, which is automatically ignored later.
Second, awk numbers are converted to strings
[chengmo@centos5 ~]$ awk 'BEGIN{a=100;b=100;c=(a" "b);print c}' 100100
You only need to connect variables to the ”” symbol.
Three, awk string connection operation
[chengmo@centos5 ~]$ awk 'BEGIN{a="a";b="b"; c=(a""b);print c}' ab
[chengmo@centos5 ~]$ awk 'BEGIN{a="a";b="b" ;;c=(a+b);print c}' 0
String concatenation operation "second",”+” number operator. The mode forces the values of the left and right sides to be converted to numeric types. Then proceed.
Installing VMware in Linux System Due to the project needs, you need to virtuali
1. Wait queue data structureThe wait queue is implemented by a doubly linked list whose elements inc
cat: display file content from the first line; nl: output line number when displayed; more: one
Sogou Pinyin input method under Linux: ibus-cloud-pinyin
10 most common questions about Linux
Linux installation method Telnet setting method
Under Linux. a/.so/.la target library difference
Linux system is gradually marginalized: the share is negligible
Linux operating system network card installation guide (below)
Network analysis example under Linux system
Solve ntp error no server suitable for synchronization found
Nginx front-end scheduling server overview
Remote access method for Linux and Windows operating systems
Win7 system screen protection how to set
Vista players look over the graphics card BIOS upgrade N items
Win10 can not upgrade the solution of 10041
The use of the Linux primary command useradd and detailed
Win7 web page watching video no sound how to do
Win2 right-click menu appears two photo viewer processing method
Under Windows7, give multiple files a key and rename
How to solve the problem of Windows 7 vulnerability patch uninstallation failure