Stop Microsoft
Miscellaneous => Programming & Networking => Topic started by: voidmain on 18 December 2002, 11:15
-
Was playing around with tput in scripts tonight and thought somebody else may be interested in doing some text screen manipulation. Rather than using the tput command you can also use ANSI sequences, tput would be more portable on all the different terminal types but using echo and ANSI strings is a lot more efficient if your terminal is ANSI capable. Here's a simple little example I just created using ANSI:
http://voidmain.kicks-ass.net/files/c2f2c.bash (http://voidmain.kicks-ass.net/files/c2f2c.bash)
http://voidmain.kicks-ass.net/files/c2f2c.ksh (http://voidmain.kicks-ass.net/files/c2f2c.ksh)
[ December 23, 2002: Message edited by: void main ]
-
tput ???
never used it. I cut and pasted your code from mozilla into gvim no problems at all.
------------------
colour chart for bash
-----------------
yes I did spell Colour correctly
--------------------------------
[ December 21, 2002: Message edited by: dbl221 ]
-
I cleaned it up a little more and did a floating point version in ksh:
http://voidmain.kicks-ass.net/files/ (http://voidmain.kicks-ass.net/files/)
-
got to love ksh eh!
one little problem...when I enter 33 deg Centagrade it calculates to 297 deg Farenheight
33C is a nice warm summer day in southers Ontario..ok I know Texas is hot but 279...hmm
ps is that ksh93 of pdksh
-
That's odd, when I run it it calculates to: 91.40F
pdksh must be f00ked up. It works fine with the "real" ksh93. Can you do floating point at all with pdksh? Maybe that's why I ditched it for the real one.
[ December 21, 2002: Message edited by: void main ]
-
voidmain your to smart, go bash your head on a wall.
-
Yep, just confirmed it. pdksh is brain dead and doesn't support floating point math. Get the real one. There is an RPM for it:
ftp://ftp.rpmfind.net/linux/contrib/libc6/i386/ksh93-2000.10.31.0-1.i386.rpm (http://ftp://ftp.rpmfind.net/linux/contrib/libc6/i386/ksh93-2000.10.31.0-1.i386.rpm)
or here:
http://www.kornshell.com/ (http://www.kornshell.com/)
[ December 22, 2002: Message edited by: void main ]
-
damn even MS basic supports floating point
-
quote:
Originally posted by dbl221:
tput ???
never used it. I cut and pasted your code from mozilla into gvim no problems at all.
------------------
colour chart for bash
-----------------
yes I did spell Colour correctly
--------------------------------
[ December 21, 2002: Message edited by: dbl221 ][/b]
You spelt colour correctly but not 'standard' (http://smile.gif)
-
TUX said
quote:
You spelt colour correctly but not 'standard'
In Canadian English it is "colour"
-
he meant you spelt the word "standard" wrong, take a closer look.