The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
[ C++ ] Drawing Program. Max_Payne High Level Programming 12 12-23-2007 03:06 AM
Still Time Today to Join the $5000 AJAXWorld Drawing - SYS-CON Media iBot UNIX and Linux RSS News 0 08-24-2007 11:50 AM
Line-drawing character! zecoj High Level Programming 5 03-10-2002 11:38 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-22-2005
abrd600 abrd600 is offline
Registered User
  
 

Join Date: Aug 2004
Location: India
Posts: 11
Drawing

Hi,

Is it possible to draw circle, box and other basic shapes using shell scripts ?

If so can anyone please tell as how to do it.

Thanks in advance.
  #2 (permalink)  
Old 08-22-2005
RishiPahuja's Avatar
RishiPahuja RishiPahuja is offline
Registered User
  
 

Join Date: Apr 2005
Location: Bangalore, India
Posts: 203
Thumbs up

To my understanding if you are expecting to draw basic shapes on a "telnet" session then at most you can achieve is character based shapes. As telnet is a charater based application.

To draw character based shapes I dont think its going to be that difficult though not as accurate you expect
  #3 (permalink)  
Old 08-23-2005
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,628
It is possible to arbitrarily set the cursor to some position, then write from there. See the TERMCAP database and tput (man tput) how that works and which limitations this procedure has.

Hope this helps
bakunin
  #4 (permalink)  
Old 08-23-2005
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
Just for fun...
Code:
awk -v X=12 -v Y=40 -v radius=12 'BEGIN{
  pi=3.142857
  system("tput clear")
  for(i=0 ;i<=359 ;i++){
    cmd=sprintf("tput cup %s %s", \
      int(.5 + X + (sin(i*pi/180)*radius)), \
      int(.5 + Y + (cos(i*pi/180)*radius)) )
    system(cmd)
    printf "*"
  }
  system("tput home")
}'
Not very circular...
Code:
                    *******
                 ****      ***
                **           **
               **             **
              **                *
             **                 **
            **                   **
            *                     *
            *                     *
           *                      **
           *                       *
           *                       *
           *                       *
           *                       *
           *                       *
           **                      *
            *                     *
            *                     *
            **                   **
             **                 **
              **               **
               **             **
                **           **
                 ***       ***
                    *******
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:36 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0