I am trying to run a shell command from within awk for each line of a file, and the shell command needs one input argument. I tried to use system(), but it didn
system()
You cannot grab the output of an awk system() call, you can only get the exit status. Use the getline/pipe or getline/variable/pipe constructs
awk '{ cmd = "your_command " $1 while (cmd | getline line) { do_something_with(line) } close(cmd) }' file