According to the documentation, by default smbclient is supposed to send all output to STDOUT. Only when the -E parameter is included on the command line should smbclient send its output to STDERR. However, when running the smbclient command via a script, when upgrading from a fairly ancient version to 3.0.21, I see that some messages are still being sent to STDERR even when I redirect STDOUT to /dev/null. Here is sample output from a command I just issued. For security reasons, I have eliminated the hostnames and path to our password file (don't want to get in trouble with the company I work for). derek.middleton@hostname$ smbclient --version Version 3.0.21 derek.middleton@hostname$ smbclient //winserver/simis -A xxxxx -c 'dir' > /dev/null Domain=[US] OS=[Windows Server 2003 3790] Server=[Windows Server 2003 5.2] derek.middleton@hostname$ smbclient //nvm0041pdv/srg -A /mis/prod/bin/scpt/samba/svc.simmis.pwd -D '/prod/00 template' -c 'get headers.txt' > /dev/null Domain=[US] OS=[Windows Server 2003 3790] Server=[Windows Server 2003 5.2] getting file \prod\00 template\headers.txt of size 64 as headers.txt (3.9 kb/s) (average 3.9 kb/s) derek.middleton@hostname$ This behaivor does not break any of my scripts, but they now produce output when I believe they're not supposed to.
See https://bugzilla.samba.org/show_bug.cgi?id=6337 for the complementary complaint (messages being sent to STDERR when they expect STDOUT).