1. 程式人生 > >awk內部呼叫外部shell命令

awk內部呼叫外部shell命令

awk uses the system function to execute any OS command, and the return code can be captured and checked, as shown below. You can also read in all the output of a system call (very handy).

When I check the code returned from the OS, zero means success. But within awk, a zero expression means false and non-zero means true. If you run the code below, you will see that "one means true".