On Thu, Aug 01, 2013 at 09:37:38AM +0200, Lakshminarasimhan Srinivasan wrote:
ldapscripts do not work from inside a "while read line" loop.
The exact same scripts were working fine until the last upgrade
-------------------------------------------------
#!/bin/bash
echo "Testing if it works outside of the loop"
ldapid
echo "Getting into the read line loop"
while read line
do
ldapid
done<"Some file"
------------------------------------------------
This sounds like a change was made to whatever package "ldapid" is in.
If ldapid reads from standard input, it will conflict with the use of
stdin by "read".
You can work around the problem by doing something like this:
while read line<&3
do
ldapid
done 3< "Some file"
This way, read isn't using the same stdin file descriptor that ldapid is
(presumably) using.
This is not a bash bug. It may or may not be an ldapid bug, as I have
no idea what that program does.