Sponsored Content
Top Forums Shell Programming and Scripting ksh: A part of variable A's name is inside of variable B, how to update A? Post 67830 by pa3be on Monday 28th of March 2005 03:12:18 PM
Old 03-28-2005
ksh: A part of variable A's name is inside of variable B, how to update A?

This is what I tried:

vara=${varb}_count
(( vara += 1 ))


Thanks for help
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to replace variable inside the variable

hi sir, i need your help for this script inside /rnmucdr/ednms05/ken/xMNBDF045_Script.sql content variable like this select * from invoice where bill_date=$BILLDATE and startNum=$STARTPARTNNUM and total_partn=$TOTALPARTN if i just paste this replace with the $SCRIPT it works great,if... (31 Replies)
Discussion started by: mani_um
31 Replies

2. UNIX for Dummies Questions & Answers

passing a variable inside a variable to a function

I would like to know how to pass a variable inside a variable to a function. sample code below -------------- for x in 1 9 do check_null $C$x ##call function to check if the value is null if then echo "line number:$var_cnt,... (2 Replies)
Discussion started by: KingVikram
2 Replies

3. Shell Programming and Scripting

passing a variable inside another variable.

Any help would be great. I know this is a dumb way of doing this, but I would like to know if there is a solution doing it this way. I'm very new at this and I'd like to learn more. Thanks! :D:D count=0 while ; do echo "enter your name" read name_$count let count=count+1 done ... (2 Replies)
Discussion started by: reconflux
2 Replies

4. Shell Programming and Scripting

variable inside variable inside loop headache

Hi Gurus I have a file called /tmp/CMDB which looks like this serial: 0623AN1208 hostname: server1 model: x4100 assetID: 1234 I am writing a for loop that will go through this file line by line creating a variable of itself. Using the first iteration of the loop (i.e. the first line) as... (6 Replies)
Discussion started by: hcclnoodles
6 Replies

5. Shell Programming and Scripting

how to pass a variable to an update sql statement inside a loop

hi all, i am experiencing an error which i think an incorrect syntax for the where clause passing a variable was given. under is my code. sqlplus -s ${USERNAME}/${PASSWORD}@${SID} << END1 >> $LOGFILE whenever sqlerror exit set serveroutput on size 1000000 declare l_rc ... (0 Replies)
Discussion started by: ryukishin_17
0 Replies

6. Shell Programming and Scripting

Not able to store command inside a shell variable, and run the variable

Hi, I am trying to do the following thing var='date' $var Above command substitutes date for and in turn runs the date command and i am getting the todays date value. I am trying to do the same thing as following, but facing some problems, unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies

7. Shell Programming and Scripting

Variable to command to Variable Question KSH

Hello, First post for Newbie as I am stumped. I need to get certain elements for a specific PID from the ps command. I am attempting to pass the value for the PID I want to retrieve the information for as a variable. When the following is run without using a variable, setting a specific PID,... (3 Replies)
Discussion started by: Coyote270WSM
3 Replies

8. Shell Programming and Scripting

Resolve variable inside another variable

Hello Everyone, I am trying to resolve a variable inside another variable.Let me go straight to the example. Input: Query=$Table_1 Join $Table_2 (Query itself is a variable here) Now for two different cases I am assigning different values to Table_1 and Table_2 Case 1:... (14 Replies)
Discussion started by: vinay4889
14 Replies

9. Shell Programming and Scripting

Return value inside isql to a shell variable in ksh

Hello, I have a shell script where I am doing an isql to select some records. the result i get from the select statement is directed to an output file. I want to assign the result to a Shell variable so that I can use the retrieved in another routine. e.g. "isql -U${USER} -P${PASSWD} -S${SERVER}... (1 Reply)
Discussion started by: RookieDev
1 Replies

10. Shell Programming and Scripting

To print value for a $variable inside a $variable or file

Hi guys, I have a file "abc.dat" in below format: FILE_PATH||||$F_PATH TABLE_LIST||||a|b|c SYST_NM||||${SRC_SYST} Now I am trying to read the above file and want to print the value for above dollar variables F_PATH and SRC_SYST. The problem is it's reading the dollar variables as... (5 Replies)
Discussion started by: abcabc1103
5 Replies
geomobjs(3U)						    InterViews Reference Manual 					      geomobjs(3U)

NAME
PointObj, LineObj, BoxObj, MultiLineObj, FillPolygonObj, Extent - helper classes that manage geometric information for structured graphics SYNOPSIS
#include <Unidraw/Graphic/geomobjs.h> DESCRIPTION
Unidraw defines several helper classes that store and manage geometric information. Structured graphics objects may use these helper classes to support their semantics. PointObj stores a point, LineObj stores two points, and MultiLineObj stores any number of points. BoxObj and FillPolygonObj define rectangular and polygonal areas, respectively. Extent stores extent information, that is, the lower left corner and center of a bounding box plus a fixed amount of extra space around the bounding box. All these classes provide operations for computing geometric information. POINTOBJ PUBLIC OPERATIONS
PointObj(Coord = 0, Coord = 0) PointObj(PointObj*) Construct a PointObj, supplying either two Coords or another PointObj to specify the instance's coordinates, which are stored in its _x and _y public members. float Distance(PointObj&) Return the distance between this and the given PointObj. LINEOBJ PUBLIC OPERATIONS
LineObj(Coord = 0, Coord = 0, Coord = 0, Coord = 0) LineObj(LineObj*) Construct a LineObj, supplying either two coordinate pairs or another LineObj to specify the instance's endpoints, which are stored in its _p1 and _p2 public members. boolean Contains(PointObj&) boolean Intersects(LineObj&) Return whether this contains the given point and intersects the given line, respectively. int Same(PointObj& p1, PointObj& p2) A helper function used in Intersects. Same returns a positive value if p1 and p2 fall on the same side of the line, 0 if both points fall on the line, or a negative value if the points are on opposite sides of the line. BOXOBJ PUBLIC OPERATIONS
BoxObj(Coord = 0, Coord = 0, Coord = 0, Coord = 0) BoxObj(BoxObj*) Construct a BoxObj, supplying either two coordinate pairs or another BoxObj to specify the instance's bottom-left and top-right cor- ners, which are stored in its _left, _bottom, _right, and _top public members. boolean Contains(PointObj&) boolean Intersects(BoxObj&) boolean Intersects(LineObj&) Return whether this contains the given point and intersects the given box or line, respectively. BoxObj operator - (BoxObj&) BoxObj operator + (BoxObj&) Compute the intersection (-) or union (+) of this and the given box, returning the result. These operations do not affect this or their argument. boolean Within(BoxObj&) Return true if this falls completely within the given box. Within will also return true if the boxes are identical. MULTILINEOBJ PUBLIC OPERATIONS
MultiLineObj(Coord* = nil, Coord* = nil, int = 0) Create a MultiLineObj, optionally supplying coordinate arrays (and their size) that define the vertices of the multiline. The Multi- LineObj does not copy these arrays but stores them directly. The MultiLineObj stores this information in its _x, _y, and _count pub- lic members. void GetBox(BoxObj&) Calculate the bounding box circumscribing the MultiLineObj's vertices and store it in the argument. boolean Contains(PointObj&) boolean Intersects(BoxObj&) boolean Intersects(LineObj&) Return whether this contains the given point and intersects the given box or line, respectively. boolean Within(BoxObj&) Return true if this falls completely within the MultiLineObj's bounding box. Within will also return true if the boxes are identi- cal. void SplineToMultiLine(Coord* cpx, Coord* cpy, int count) void ClosedSplineToMultiLine(Coord* cpx, Coord* cpy, int count) Linearize the open or closed B-Spline defined by the given set of control points and store the result in this. These operations store the linearized result in internal buffers and assign the addresses of these buffers to _x and _y; they do not delete _x and _y if they are non-nil prior to assignment. MULTILINEOBJ PROTECTED OPERATIONS
void GrowBuf() Increase the size of the internal buffers used to store linearized splines. boolean CanApproxWithLine( double x0, double, y0, double x1, double y1, double x2, double y2 ) Return whether two connected line segments defined by the given three points can be approximated visually with a single line between the endpoints. void AddLine(double x0, double y0, double x1, double y1) Add a line to the internal buffer of vertices. void AddBezierArc( double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3 ) Add lines approximating the appearance of a Bezier arc defined by the given points to the internal buffer of vertices. void CalcSection( Coord cminus1x, Coord cminus1y, Coord cx, Coord cy, Coord cplus1x, Coord cplus1y, Coord cplus2x, Coord cplus2y ) Add a Bezier arc to the internal buffer of vertices based on a series of four B-spline control points, the one before and the two after (cx, cy). FILLPOLYGONOBJ PUBLIC OPERATIONS
FillPolygonObj(Coord* = nil, Coord* = nil, int = 0) Create a new FillPolygonObj, optionally specifying its vertices. If vertices are supplied, then the constructor uses Normalize (described below) to store a normalized set of vertices in the FillPolygonObj's _normx, _normy, and _normCount public members. FillPolygonObj is a subclass of MultiLineObj; thus it stores the constructor arguments in its _x, _y, and _count public members. virtual ~FillPolygonObj() The destructor deletes the _normx and _normy arrays. boolean Contains(PointObj&) boolean Intersects(BoxObj&) boolean Intersects(LineObj&) Return whether this contains the given point and intersects the given box or line, respectively. FILLPOLYGONOBJ PROTECTED OPERATIONS
void Normalize() Copy the vertices defined by _x, _y, and _count into _normx, _normy, and _normCount such that (_normx[0], _normy[0]) is the lower- leftmost vertex and there are no redundant vertices. EXTENT PUBLIC OPERATIONS
Extent( float left = 0, float bottom = 0, float cx = 0, float cy = 0, float tol = 0 ) Extent(Extent&) Construct a new Extent, optionally supplying its parameters explicitly or providing a existing Extent to copy. The parameters are stored in the Extent's _left, _bottom, _cx, _cy, and _tol public members. boolean Undefined() Return whether the extent is undefined, that is, if (_left, _bottom) and (_cx, _cy) are the same point. boolean Within(Extent&) Return true if the given extent circumscribes this. Within will also return true if the extents are identical. void Merge(Extent&) Enlarge this extent to subsume area of the given extent. SEE ALSO
Graphic(3U) Unidraw 2 February 1991 geomobjs(3U)
All times are GMT -4. The time now is 07:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy