When I pass the Command Line arguments to my script, We have to access that value by using $1, $2 etc., Similarly, when we are using awk, we can mention the columns of a file as $1,$2 etc.,
#!/bin/bash
cat $1 | awk '$1 > 20'
- Let us assume I have passed a file name as a command line argument, and we can refer that argument by using $1.
Let us assume the file content is as follows.
20 A 10 B 5 D 13 K 50 C
How can I tell, when reading this code, whether it will access the command line $1
-- the input file name -- or the first column of the output from cat
?