Here's my predicament. I'm developing a perl telnet script that uses Expect to spawn a new telnet process and feed data (non-interactively) into it.
Everything works fine when I call the script from a terminal - however, if I start the script from cron I am unable to login to the remote device because the Window size negociation fails - as my client sends a window size of 0x0 (instead of 80x24).
Apparently telnet gets this window size from its master PTY - which isn't a TTY if it's called from cron. Most likely telnet is getting these settings using ioctl or some similar mechanism, because trying to override these settings by environment variables failed (ROWS=200 COLUMNS=80 telnet test).
I ran stty from cron and redirected the output to a file. Problem is stty complains when it's run from cron: /bin/stty: standard input: Invalid argument
Do you know any way to:
1) override the number of rows/columns telnet sends to the remote device
2) start a tty and start telnet inside that tty (from cron)