Re: How to correctly test for existence of pseudo tty?



This just gets stranger and stranger.

After I started the previously mentioned script through cron and then
did a "ps -ef | grep <script name>" I noticed that it had pty0
assigned to it.

After I posted, I just happened to try that ps command again and no
pty was listed. Furthermore, /var/adm/sulog shows tty??.

I then did some tests with cron by just having lines like "su -
<account name> -c "tty > /tmp/foo" and the output file ends up with
"not a tty".

So, if its not cron creating a pty what is? The "su -" is doing a full
login and thus runs the shell's .profile. So what's setting the pty
up? There's nothing in the original script that makes the su call.

.