I think "ERROR: * is not a valid argument for ..." messages should go to stderr

16 views
Skip to first unread message

Andrew Hilborne

unread,
May 31, 2016, 7:39:25 AM5/31/16
to Google Apps Manager
Is there any reason that messages like this:

ERROR: orgUnitPath is not a valid argument for "gam print users"

.. and many others, are printed to stdout? I know that gam isn't just a unix/linux program, but standard behaviour is to print results to stdout, errors to stderr. This is very much expected behaviour, and allows scripts which do something like this:

if gam some command >results 2>errors; then
    (echo 'Command succeed. Results below'; cat results) | Mail -s 'Overnight gam command' administrator
else
    Mail -s 'Overnight gam failed' support <errors
fi

Right now, I am simply regularly surprised when these errors pop up on an unexpected output channel (stdout.)

Reply all
Reply to author
Forward
0 new messages