size of the terminal window | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

size of the terminal window

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-04-2010
Gengis-Kahn Gengis-Kahn is offline
Registered User
 
Join Date: Apr 2010
Last Activity: 6 May 2010, 2:50 AM EDT
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
size of the terminal window

Hi,

I am programming a script that shows a figure on screen but I would be centered, so What I have to use command to get the size of the window?


Thanks a lot,
Sponsored Links
    #2  
Old 04-04-2010
TonyFullerMalv's Avatar
TonyFullerMalv TonyFullerMalv is offline Forum Advisor  
Registered User
 
Join Date: Sep 2008
Last Activity: 1 July 2013, 6:45 PM EDT
Location: Malvern, Worcs. U.K.
Posts: 1,033
Thanks: 0
Thanked 8 Times in 8 Posts
The command that will help you is resize the man page is at:
Man Page for resize (Linux Section 1) - The UNIX and Linux Forums
Sponsored Links
    #3  
Old 04-04-2010
alister alister is offline
Registered User
 
Join Date: Dec 2009
Last Activity: 11 June 2014, 8:40 PM EDT
Posts: 3,231
Thanks: 179
Thanked 973 Times in 789 Posts
If $COLUMNS and $LINES aren't set in the script's environment, perhaps you can use:

Code:
tput cols  # columns (width)
tput lines # lines (height)

Regards,
Alister
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Preventing the terminal window to resize figaro UNIX for Dummies Questions & Answers 0 10-07-2009 06:45 AM
How can I list all users from a terminal window in MAC? Juan Dent UNIX for Dummies Questions & Answers 1 08-23-2008 02:50 PM
Script to launch terminal window? omerta Solaris 5 06-30-2005 05:48 PM
Find and activate a terminal window cmp1jrv Solaris 0 01-27-2005 11:48 AM
How do I dial a number from the terminal window? fundidor UNIX for Dummies Questions & Answers 12 12-29-2004 03:21 PM



All times are GMT -4. The time now is 01:34 PM.