Three ways to call awk

Three ways to call awk

 

       There are three ways to call awk, one is the shell command line method, and the other two are to write the awk program into a script file, and then execute the script file. The command formats of the three modes are summarized as follows:

 

       1. Enter the command to call awk on the Shell command line, the format is:
       awk [-F field separator] 'awk program segment'
       Note that the input file needs to use single quotation marks to enclose the awk program segment.

 

       Second, write the awk program segment into the script file, and then call it through the awk command, the format is:
       awk -f awk script file input file
       awk uses the -f option to call the awk script file.

 

       3. After inserting the awk command into the script file, the most common way is to set the script file as an executable file, and then execute the script file directly. The format is:
       ./awk script file input file

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326681066&siteId=291194637