From: Tim Pease Date: 2007-08-08T03:55:42+09:00 Subject: Re: Need Solaris Help On 8/7/07, James Edward Gray II wrote: > > Can anyone provide an equivalent technique that works on Solaris? > $ cat t.rb def terminal_size m = %r/rows\s(?:=\s)?(\d+);.*columns\s(?:=\s)?(\d+);/.match(`stty -a`) [Integer(m[2]), Integer(m[1])] end puts terminal_size.inspect $ uname -a SunOS hedwig 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Blade-1500 $ ruby t.rb [80, 36] And on the Linux box ... $ uname -a Linux pong 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12 15:37:31 EDT 2007 i686 i686 i386 GNU/Linux $ ruby t.rb [80, 24] Blessings, TwP