Creating a rectangle in KSH
am 11.01.2008 17:22:08 von apogeusistemasHi:
Can You tell me if is there any way to create
a rectangle using tput or terminfo ?
Thank You.
Hi:
Can You tell me if is there any way to create
a rectangle using tput or terminfo ?
Thank You.
On 2008-01-11, apogeusistemas@gmail.com
>
>
> Hi:
>
> Can You tell me if is there any way to create
> a rectangle using tput or terminfo ?
>
> Thank You.
You can draw a rectangle using space, + - and | characters, or look for
"alternate character set" in "man terminfo".
On Jan 11, 8:47 am, Bill Marcum
> On 2008-01-11, apogeusiste...@gmail.com
>
>
>
> > Hi:
>
> > Can You tell me if is there any way to create
> > a rectangle using tput or terminfo ?
>
> > Thank You.
>
> You can draw a rectangle using space, + - and | characters, or look for
> "alternate character set" in "man terminfo".
Bahh, + and - are no fun. :)
The below is an old (very old) script I wrote to play with the
alternative char set.
Hopefully the formating will not get too munged.
#!/usr/bin/ksh
#$1=Top left "x,y"
#$2=Bottom right "x,y"
tlx=${1%%,[0-9]*}
tly=${1##[0-9]*,}
brx=${2%%,[0-9]*}
bry=${2##[0-9]*,}
tput enacs
tput smacs
length=$(((${brx}-${tlx}-1)))
height=$(((${bry}-${tly})))
tput cup ${tly} ${tlx} && echo "l\c"
count=0
while [ ${count} -lt ${length} ]
do
echo "q\c" && count=$(($count+1))
done
echo "k\c"
count=1
while [ ${count} -le ${height} ]
do
tput cup $((${tly}+${count})) ${tlx} && echo "x\c"
tput cup $((${tly}+${count})) ${brx} && echo "x\c"
count=$(($count+1))
done
tput cup ${bry} ${tlx} && echo "m\c"
count=0
while [ ${count} -lt ${length} ]
do
echo "q\c" && count=$(($count+1))
done
echo "j\c"
tput rmacs
tput cup `tput lines`
--Brett Monroe
On 23 jan, 23:01, "mr.bmon...@gmail.com"
> On Jan 11, 8:47 am, Bill Marcum
>
> > On 2008-01-11, apogeusiste...@gmail.com
:
>
> > > Hi:
>
> > > Can You tell me if is there any way to create
> > > a rectangle using tput or terminfo ?
>
> > > Thank You.
>
> > You can draw a rectangle using space, + - and | characters, or look for
> > "alternate character set" in "man terminfo".
>
> Bahh, + and - are no fun. :)
> The below is an old (very old) script I wrote to play with the
> alternative char set.
> Hopefully the formating will not get too munged.
>
> #!/usr/bin/ksh
>
> #$1=3DTop left "x,y"
> #$2=3DBottom right "x,y"
>
> tlx=3D${1%%,[0-9]*}
> tly=3D${1##[0-9]*,}
> brx=3D${2%%,[0-9]*}
> bry=3D${2##[0-9]*,}
>
> tput enacs
> tput smacs
> length=3D$(((${brx}-${tlx}-1)))
> height=3D$(((${bry}-${tly})))
>
> tput cup ${tly} ${tlx} && echo "l\c"
> count=3D0
> while [ ${count} -lt ${length} ]
> do
> =A0 =A0echo "q\c" && count=3D$(($count+1))
> done
> echo "k\c"
>
> count=3D1
> while [ ${count} -le ${height} ]
> do
> =A0 =A0tput cup $((${tly}+${count})) ${tlx} && echo "x\c"
> =A0 =A0tput cup $((${tly}+${count})) ${brx} && echo "x\c"
> =A0 =A0count=3D$(($count+1))
> done
>
> tput cup ${bry} ${tlx} && echo "m\c"
> count=3D0
> while [ ${count} -lt ${length} ]
> do
> =A0 =A0echo "q\c" && count=3D$(($count+1))
> done
> echo "j\c"
>
> tput rmacs
> tput cup `tput lines`
>
> --Brett Monroe
Running this shell shows me nothing... !!!???