Joe Beanfish wrote:
> zix wrote:
>> Hi,
>> I can automate to enter passwd by (echo newpass;sleep 1;echo
>> newpass|grep passwd), but if i apply the same over gpasswd, it gives
>>
>> (echo new;sleep 1;echo new|gpasswd expertgrp)
>> new
>> gpasswd: Not a tty
>>
>> how to get rid of this and automate it(without using expect)? any clue/
>> idea?
>
> That message indicates that the program, gpasswd, is intentionally checking
> if you are a user typing vs. piping/redirecting like you're doing. Chances
> are there's no way around it unless gpasswd has a command line option to
> not require tty. You may need a different tool.
More likely, gpasswd wants to disable echo via tcgetattr/tcsetattr/ioctl
and this definitely fails if stdin is "Not a tty".
The manual page does not show an option to circumvent this.
--
These are my personal views and not those of Fujitsu Technology Solutions!
Josef Möllers (Pinguinpfleger bei FTS)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details:
http://de.ts.fujitsu.com/imprint.html