20130329 capturing both stdout and stderr from ldapmodify - plembo/onemoretech GitHub Wiki

title: Capturing both stdout and stderr from ldapmodify link: https://onemoretech.wordpress.com/2013/03/29/capturing-both-stdout-and-stderr-from-ldapmodify/ author: phil2nc description: post_id: 4582 created: 2013/03/29 16:35:57 created_gmt: 2013/03/29 20:35:57 comment_status: closed post_name: capturing-both-stdout-and-stderr-from-ldapmodify status: publish post_type: post

Capturing both stdout and stderr from ldapmodify

Or ldapsearch, actually. Syntax follows. Making a note of this because I actually forgot how to do it and stumbled around before checking one of my older scripts.

ldapmodify -h localhost -D "cn=directory manager" -w xxxx -c -f changes.ldif >ops.log 2>&1

That's all there is to it. The key is in the "2>&1" at the end, which captures stderr and pipes it to stdout for inclusion of both in your log file.

Copyright 2004-2019 Phil Lembo