<<< Date Index >>>     <<< Thread Index >>>

Re: Adding entries to ldap addressbook



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday, February 29 at 12:46 AM, quoth Nathan Huesken:
> So the script needs to get the eMail from stdin, but also be 
> intaractive with the user (utilizing the read command).
>
> If I do:
> <pipe-message>script<enter>

The reason the read command exits is that, by default, the read 
command will read from stdin. Since stdin is the *message*, which by 
that point you've already processed, you need to get the read command 
to read from the *terminal* instead of stdin.

The same thing would happen if you did something like this:

     cat message | script

So, in your script, you have to be able to tell the read command to 
read from the terminal.

The easiest way may be to do something like this in your script:

     read -p 'is this correct? [y/n] ' answer <$TTY

~Kyle
- -- 
Where justice is denied, where poverty is enforced, where ignorance 
prevails, and where any one class is made to feel that society is an 
organized conspiracy to oppress, rob and degrade them, neither persons 
nor property will be safe.
                                                   -- Frederick Douglas
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFHx155BkIOoMqOI14RAugMAKDQEquNeZM8j1honLx58fGRcQuFPgCgo4QE
nIknt+rz0s9nll5o4GmJBvk=
=wE4t
-----END PGP SIGNATURE-----