|Next||Program Repair Shop||23|
I said I thought this code had been written by an ex-C-programmer
Why not an ex-shell programmer?
Well, mainly because shell programmers never declare anything
system("unzip -v '$incoming_dir/$file' 2>&1 >/dev/null");
Here the intent was to discard standard output and standard error
But it only discards stdout
2>&1 means "send stderr to wherever stdout is going"
>/dev/null means "send stdout to /dev/null"
The order is important here
It should have been:
system("unzip -v '$incoming_dir/$file' >/dev/null 2>&1");
That's not a red flag; just a bug
|Next||Copyright © 2006 M. J. Dominus|