I've been wondering if I can make mutexes much easier to use in C++ with creative use of a locking class and variable scope, but I'm not sure if things happen in the order I want. Here's pseudocode for something that could use the class:
int someclass::getvalue()
{
int retval;
... (0 Replies)
Hi,
I am stuck while developing a shell sub-routine which checks the log file for "success" or "failure". The subroutine reads the log file and checks for key word "success", if found it set the variable (found=1). It returns success or failure based on this variable.
My problem is, I can... (2 Replies)
Hi All,
I am new to unix shell scripting,
in the below script "num" is an input file which contains a series of numbers example :
2
3
5
8
I want to add the above all numbers and want the result finally outside the while loop. it prints the value zero instead of the actual expected... (13 Replies)
hi all,
i'm using the following script,
Status=1
Function_do ()
{
while read line;
do
if ; then
#echo $line
if ; then
Status=0
echo " LINKINK ERROR "
fi
fi
done < ldd.log
}
Function_do (4 Replies)
cat test.ksh
#!/usr/bin/ksh
VAR="Dear Friends \n How are you? \n Have a nice day \n"
export VAR
echo "Inside test.ksh";
./test.pl
cat test.pl
#!/usr/bin/perl
print "Inside test.pl \n";
print "$VAR";
Output:
./test.ksh
Inside test.ksh
Inside test.plWhat I want to achieve is, I... (1 Reply)
Hi All,
I've been researching this problem and I am pretty sure that the issue is related to the while loop and the piping. There are plenty of other threads about this issue that recommend removing the pipe and using redirection. However, I haven't been able to get it working using the ssh and... (1 Reply)
Hi,
I use Korn Shell. Searched Forum and modified the way the file is input to the while loop, but still the variable does not seem to be retaining the final count.
while read name
do
Tmp=`echo $name | awk '{print $9 }'`
Count=`cat $Tmp | wc -l`... (6 Replies)
Hello! Before you "bash" me with
- Not another post of this kind
Please read on and you will understand my problem...
I am using the below to extract a sum of the diskIO on a Solaris server.
#!/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin; export PATH
TEMP1="/tmp/raw-sar-output.txt$$"... (3 Replies)
Hi All
Is there is any way to maintain the scope of the variable in unix
Example
x=1
j=1
while
do
..
....
....
while
do
..
..
x=x+1
done
#inner most while loop ends here
done
#outer loop ends here (8 Replies)
I have to admit that i have not used Perl at all and this is a singular occasion where i have to patch an existing Perl script. I dearly hope i do not have to do it again for the next 15 years and therefore try to avoid having to learn the programming language in earnest.
The OS is AIX 7.1, the... (2 Replies)
Discussion started by: bakunin
2 Replies
LEARN ABOUT REDHAT
xtsetarg
XtSetArg(3Xt) XT FUNCTIONS XtSetArg(3Xt)NAME
XtSetArg, XtMergeArgLists - set and merge ArgLists
SYNTAX
XtSetArg(arg, name, value)
Arg arg;
String name;
XtArgVal value;
ArgList XtMergeArgLists(args1, num_args1, args2, num_args2)
ArgList args1;
Cardinal num_args1;
ArgList args2;
Cardinal num_args2;
ARGUMENTS
arg Specifies the name-value pair to set.
args1 Specifies the first ArgList.
args2 Specifies the second ArgList.
num_args1 Specifies the number of arguments in the first argument list.
num_args2 Specifies the number of arguments in the second argument list.
name Specifies the name of the resource.
value Specifies the value of the resource if it will fit in an XtArgVal or the address.
DESCRIPTION
The XtSetArg function is usually used in a highly stylized manner to minimize the probability of making a mistake; for example:
Arg args[20];
int n;
n = 0;
XtSetArg(args[n], XtNheight, 100);n++;
XtSetArg(args[n], XtNwidth, 200);n++;
XtSetValues(widget, args, n);
Alternatively, an application can statically declare the argument list and use XtNumber:
static Args args[] = {
{XtNheight, (XtArgVal) 100},
{XtNwidth, (XtArgVal) 200},
};
XtSetValues(Widget, args, XtNumber(args));
Note that you should not use auto-increment or auto-decrement within the first argument to XtSetArg. XtSetArg can be implemented as a
macro that dereferences the first argument twice.
The XtMergeArgLists function allocates enough storage to hold the combined ArgList structures and copies them into it. Note that it does
not check for duplicate entries. When it is no longer needed, free the returned storage by using XtFree.
SEE ALSO XtOffset(3Xt)
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface
X Version 11 Release 6.6 XtSetArg(3Xt)