07-24-2019
Try consistently putting spaces around [, ], and =.
This User Gave Thanks to RudiC For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In a ksh script on an AIX box running a jillion oracle database processes, I'm setting a variable to one of two possible arguments, depending on cmd line arguments.
FINDIT="ps -ef | grep oracle | grep DBexport | grep rshrc"
-or-
FINDIT="ps -ef | grep oracle | grep prod | grep runback"
I... (3 Replies)
Discussion started by: zedmelon
3 Replies
2. UNIX for Dummies Questions & Answers
Just a quick question. If I have a script that calls another script while running, is it possible for the second script to reference a variable in the first script and if so, how. Is it scriptname.sh:$VARIABLE for a global variable and can you do scriptname.sh:function $VARIABLE or am I off my... (1 Reply)
Discussion started by: kirkm76
1 Replies
3. Shell Programming and Scripting
Hi All,
I have declared a variable in script1 and assign a value for it. In script2 i'll call script1 and then I want the value of variables set in script1.
I have tried with export, but in vain.
How can I achive this?
Below is the two scripts.
--script1
#!/usr/bin/ksh
echo $1... (1 Reply)
Discussion started by: javaDev
1 Replies
4. UNIX for Dummies Questions & Answers
Hey all,
I'm wondering how you pass variable's that are defined in one script to another script that's been called by that first script.....
Best regards,
Jaz (1 Reply)
Discussion started by: Jazmania
1 Replies
5. Shell Programming and Scripting
Hi all.
I need to pass a value from a script that runs in a sub-shell, back into the calling shell like below (or into script 2 directly):
outer_script
export param=value1
script1 $param
(in script1: export param=value2)
script2 $param
($param is now value1, not value2... (4 Replies)
Discussion started by: bbergstrom74
4 Replies
6. Shell Programming and Scripting
Friends,
I am using ksh under SunoS. This is what I have
In file1.sh
NOW=$(date +"%b-%d-%y")
LOGFILE="./log-$NOW.log"
I will be using this file through file1.sh as log file.
I have another script file2.sh which is being called inside my file1.sh. I would like to use the same log... (6 Replies)
Discussion started by: dahlia84
6 Replies
7. UNIX for Advanced & Expert Users
Hello Everyone,
I want to know how can we make the variables of one script available for the other script?
for example i have three scripts variable_availability.sh,first.sh,second.sh and a file containing variables called common
----------------------------------
cat variable_availability.sh... (2 Replies)
Discussion started by: Kesavan
2 Replies
8. Shell Programming and Scripting
Hello everyone.
I'm trying to create a conf file with variables that my other scripts will use.
I have several scripts that use the same variables, and since I don't know how to read them from an external file, i define them in each script (and then if i want to change one's value i need to... (4 Replies)
Discussion started by: moshe88
4 Replies
9. Shell Programming and Scripting
I have written a program for some data analysis. It is gettin long. I would like to restructure it so that i can have a master file which controls multiple subscripts in order to make it easier to understand.
I need to be able to define variables in the master script which are used by all three... (2 Replies)
Discussion started by: carlr
2 Replies
10. Shell Programming and Scripting
Hello, I have two bash scripts like the following:
script 1:
#!/bin/bash
var=WORLD
bash path/to/second/script/script2.bash
script 2:
#!/bin/bash
echo "HELLO $var"
I expected the output to be "HELLO WORLD" but instead, I get "HELLO". I understand that when I envoke another bash... (2 Replies)
Discussion started by: jl487
2 Replies
LEARN ABOUT ULTRIX
dwtresolvepartoffsets
DwtResolvePartOffsets(3Dwt) DwtResolvePartOffsets(3Dwt)
Name
DwtResolvePartOffsets - Allows writing of upward-compatible applications and widgets.
Syntax
void DwtResolvePartOffsets(widget_class, offset)
WidgetClass widget_class;
DwtOffsetPtr *offset;
Arguments
widget_class
Specifies the widget class pointer for the created widget.
offset Specifies the offset record.
Description
The use of offset records requires one extra global variable per widget class. The variable consists of a pointer to an array of offsets
into the widget record for each part of the widget structure. The DwtResolvePartOffsets function allocates the offset records needed by an
application to guarantee upward-compatible applications and widgets. These offset records are used by the widget to access all of the wid-
get's variables. A widget needs to take the following steps:
o Instead of creating a resource list, the widget creates an offset resource list. To help you accomplish this, use the DwtPartResource
structure and the DwtPartOffset macro. The DwtPartResource data structure looks just like a resource list, but instead of having one
integer for its offset, it has two shorts. This gets put into the class record as if it were a normal resource list. Instead of
using XtOffset for the offset, it uses DwtPartOffset.
o Instead of putting the widget size in the class record, the widget puts the widget part in the same field.
o Instead of putting XtVersion in the class record, the widget puts XtVersionDontCheck in the class record.
o The widget defines a variable to point to the offset record. This can be part of the widget's class record or a separate global vari-
able.
o In class initialization, the widget calls DwtResolvePartOffsets, passing it the offset address and the class record. This does sev-
eral things:
o Adds the superclass (which, by definition, has already been initialized) size field to the part size field.
o Allocates an array based upon the number of superclasses.
o Fills in the offsets of all the widget parts with the appropriate values, determined by examining the size fields of all super-
class records.
o Uses the part offset array to modify the offset entries in the resource list to be real offsets, in place.
o Instead of accessing fields directly, the widget must always go through the offset table. You will probably define macros for each
field to make this easier. Assume an integer field ``xyz'':
#define BarXyz(w) (*(int *)(((char *) w) + offset[BarIndex] +
XtOffset(BarPart,xyz)))
The DwtField macro helps you access these fields. Because the DwtPartOffset and DwtField macros concatenate arguments, you must
ensure there is no space before or after the part argument. For example, the following do not work because of the space before or
after the part (Label) argument:
DwtField(w, offset, Label, text, char *)
DwtPartOffset( Label, text).
Therefore, you must not have any spaces before or after the part (Label) argument, as illustrated here:
DwtField(w, offset,Label, text, char *)
See Also
Guide to the XUI Toolkit: C Language Binding
Guide to the XUI Toolkit Intrinsics: C Language Binding
DwtResolvePartOffsets(3Dwt)