awk:awk_commands
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
awk:awk_commands [2020/07/15 09:30] – external edit 127.0.0.1 | awk:awk_commands [2022/06/13 09:32] (current) – peter | ||
---|---|---|---|
Line 3: | Line 3: | ||
Commands used by AWK can come from two locations: | Commands used by AWK can come from two locations: | ||
- | * They can be specified on the command line, as used in the above examples. | + | * They can be specified on the command line. |
* Alternatively they can come from a source file. If such is the case, AWK is alerted to this occurrence by means of the **-f** option. | * Alternatively they can come from a source file. If such is the case, AWK is alerted to this occurrence by means of the **-f** option. | ||
---- | ---- | ||
- | Assuming a file exists with the following contents: | + | Assuming a file, **test.txt**, |
< | < | ||
10 | 10 | ||
- | 11 | + | 11 |
12 | 12 | ||
13 | 13 | ||
Line 34: | Line 34: | ||
<code awk> | <code awk> | ||
- | awk -f awklist | + | awk -f awklist test.txt |
</ | </ | ||
- | which will display something like: | + | returns: |
< | < | ||
Line 43: | Line 43: | ||
Roux 45 | Roux 45 | ||
- | Virginia | + | Virginia |
Roux 45 | Roux 45 | ||
Line 59: | Line 59: | ||
</ | </ | ||
- | Notice that the apostrophes are not used anywhere within the source file or when calling it at the command line. | + | <WRAP info> |
+ | **NOTE: | ||
- | They are only for use in differentiating the commands on the command line from file names. | + | * They are only for use in differentiating the commands on the command line from file names. |
+ | |||
+ | </ | ||
awk/awk_commands.1594805433.txt.gz · Last modified: 2020/07/15 09:30 by 127.0.0.1