[Seattle-SAGE] Redirect stderr and stdout?

Kurt Buff kurt.buff at gmail.com
Mon Feb 6 16:27:20 PST 2006

Atom Powers wrote:
> I'm trying to write a script that tests how long it takes to list the
> shares on a samba server and prints the result to stdout. But I don't
> want a list of all the shares, which smbclient normally sends to
> stdout.
> So far I have:
> $ /usr/bin/time -h `which smbclient` -N -L ${server} 1> /dev/null
> Problem is: the time outuput goes into stderr and I need it to go to
> stdout; if I "2>1" then it goes into /dev/null. Smbclient outputs a
> lot of data to stdout that I don't want (the list of shares).
> Any ideas?

$ date && /usr/bin/time -h `which smbclient` -N -L ${server} 1>
/dev/null && date


More information about the Members mailing list