Miscellaneous > Programming & Networking
bash shell programming
voidmain:
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.ksh
[ December 23, 2002: Message edited by: void main ]
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
--------------------------------
--- Code: ---
--- End code ---
[ December 21, 2002: Message edited by: dbl221 ]
voidmain:
I cleaned it up a little more and did a floating point version in ksh:
http://voidmain.kicks-ass.net/files/
dbl221:
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
voidmain:
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 ]
Navigation
[0] Message Index
[#] Next page
Go to full version