shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] plot script question


From: Julio Neves
Subject: Re: [shell-script] plot script question
Date: Thu, 22 Nov 2001 09:47:47 -0300

#!/bin/sh

i=1
str=
while true
do
        echo "Enter the ${i}nd X-axis value"
        read X
        if [ ! "$X" ]
        then
                break
        fi
        if expr $X + 1 > /dev/null 2>&1
        then
                echo OK, its a number
        else
                echo ERROR, only integer avoid
        fi
 
... # at this point do the same to catch Y-axis value
        str=$str,pic\($X,$Y\)
        i=`expr $i + 1`
done
plot=`echo "$str" | cut -c2-  # cutting the 1st position. It's a comma.

Some mistake may occurs; I haven't tested the script. You can improve it 
using tput cup row col for positioning the echoes and the reads.

[ ]s,
Julio Cezar Neves


Favor responder a address@hidden
Para:   address@hidden
cc: 
Assunto:        [shell-script] plot script question

Hi,
i have a unix software that has a function
"plot=pic(x,y)".This draws the row x and column y of
image file pic and on. This will
refreshes the plot each time and does not keep the
previous one(s). Now, to plot and keep adding
(appending) without deleting the  previous drawn
lines, the command would be: 
"plot=pic(1,1),pic(2,2),pic(3,3),..". This will plot a
range of rows 
and coulmns (by appending). how can i automate this so
that user can  enter range of rows and columns to
plot?.
Jim

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

Yahoo! Groups Sponsor



Sair da lista: address@hidden
Banco Dados:   http://www.egroups.com/group/shell-script 

Seu uso do Yahoo! Grupos é sujeito aos Termos do Serviço Yahoo!. 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]