Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking Terminal Size in Shell Script 1

Status
Not open for further replies.
Jun 27, 2003
53
US
I'm writing a shell script under bash and I would like to have the script check the terminal size if possible. Anyone know of a way to do so? All I want it to do is check the size of the terminal a user has once, when the user runs the script.
 
What exactly do you mean by "terminal size" ?

Laurie.
 
not guarateed to work in all the shells, but:

echo $COLUMNS
echo $LINES


#-- or and parse out the sizes
stty

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
sorry, should have been more clear... just the terminal I use to get to the box. so, i use putty or securecrt to ssh to the box, and i'd like to have the script check the size of that terminal. if you're familiar with the program ettercap under linux, it will tell you if the window is too small when you run it... thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top