resize

Hello,

I created a script that runs perfectly on 2 different account but I it will not run in 2 others (HP-UX). I noticed that the problem is caused by the resize command in the .profile of the problematic accounts. Since it is a prod server, I dont want to remove it witout knowing what it is being used for.

Can somebody briefly explain what resize is used for?

P.S: I 've read the man.

Thank you in advance.

It resized the terminal to the size of your current window. It is useful when you connect to the server's console, in which case without using it, effective usage area would be limited, even if you had space in your window. If you want to see example of that command working, try this:

$ stty cols 80
$ stty rows 25
$ top 
(exit top)
$ resize
$ top
1 Like

So most likely it will not affect any cron jobs script. Just visual impact, if applicable ?

Nothing in the .profile will impact a cron job in any way, since it's not automatically sourced, as opposed to an interactive shell. Better check if all paths to applications are correct, since cron won't know about any changes to the PATH variable.

1 Like

Part of my script

#!/bin/sh

(echo open 10.246.224.61
sleep 2
echo user
sleep 2
echo pass
sleep 2
echo exit) | telnet

resize on my .profile will actually prevent the exit command to exit telnet:
esize: unknown character, exiting.
It will not close the connection
If I remove resize it works OK.

Any way to overcome this without removing resize ?