Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2>&1 doesn't deliver sorted output

Status
Not open for further replies.

BScharpf

Programmer
May 6, 2003
1
DE
Hello,

I want to write the output of ldapadd to a file. Now, ldapadd uses stdout to show which is the dn that should be added, and stderr, if anything didn't work correctly.

On my screen, it looks like this:

adding new entry cn=... <written to stdout>
ldap_add_s: Object class violation <written to stderr>

adding new entry cn=... <written to stdout>
ldap_add_s: Already exists <written to stderr>

...

When I redirect it to a file using
ldapadd ... > file 2>&1, the output is some kind of bundled:

adding new entry cn=...
adding new entry cn=...

ldap_add_s: Object class violation
ldap_add_s: Already exists

Someone told me that stdout is buffered, stderr not. What can I do to get the result printed on my screen written in a file?

Thanks,

Bettina
 
Recall that applications write to stdout and stderr as separate files. I don't think it is a buffering issue at all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top