I am writing an AWK script that starts an infinite loop – hence in the script I validate presence of file in a specified path if so I would exit from the infinite loop :
while ( ("ls -l /tmp/STOP" |& getline var4) > 0) {
exit 0
}
close("ls -l /tmp/STOP")
The issue is that I get standard error during the run time when the file is not there:
ls: /tmp/STOP: No such file or directory
How can we avoid this standard error message on the console?
Try redirecting the error stream to
/dev/null: