08-13-2009
perl if condition problem
if ( ( ( $val eq "ssd_max_throttle" ) || ( $val eq "ssd_io_time" ) ) && ( $proc eq "i386" ) ) {
print "im in";
next CONFLINE;
}
The code never goes in to the braces, even though $proc is i386,
and when the larger code parses thru values of Solaris kernel variables, and $var becomes ssd_max_throttle and then ssd_io_time.
If I eliminate the && ( test for $proc ) it goes into the braces.
I have printed out proc just outside this statement, and it is getting set as i386.
What am I doing wrong with this if statement ?
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi, :)
pls consider the following if statement
if //g') ]
then
........
else
.......
when i execute the script i am getting the following error
'(' unexpected
I am not able to find the mistake.
could anybody tell where i did mistake.
cheers
RRK (13 Replies)
Discussion started by: ravi raj kumar
13 Replies
2. Shell Programming and Scripting
Hi ,
I am trying the following simple script . But it is always giving 1 output. Dont know why
#!/bin/sh
find . -name "a.log"
if ; then
echo "1"
else
echo "0"
fi
Kindly advice. it is giving 1 output even when the a.log file is not there (26 Replies)
Discussion started by: himvat
26 Replies
3. Shell Programming and Scripting
#!/usr/bin/perl
$output1 = "/home/log.txt"
$output2 = "/home/grep.txt"
#Statement1 creates an output file called log.txt.
#Statement2 greps a line from log.txt and store the result in grep.txt
I want to create a condition where if the file grep.txt is empty repeat process.
Thanks. (1 Reply)
Discussion started by: sureshcisco
1 Replies
4. Shell Programming and Scripting
Hi,
I need to use if condition for search a file pattern on a particular location.
cd $file_Path
if ||
then
do this
else
do that
fi
Can someone help me with the if part, how i can put those conditions?
make sure format should be *.file* and *.file
file is a keyword which i... (5 Replies)
Discussion started by: amit.mathur08
5 Replies
5. Shell Programming and Scripting
Hello,
I want to check if all element of an array have the same value regardless the length of the array.
example:
@array1 = qw(44 44 44 44);
@array2 = qw(55 55 55 55 55 55 55);
Please advice,
Ahmed (11 Replies)
Discussion started by: ahmed_zaher
11 Replies
6. Shell Programming and Scripting
Hi All,
I'm a newbie here, I'm just wondering how can i disable my 1st sed command if there's no file found on Yes_Directory and process instead the No_Directory because there's a file found on it.
Yes_Directory="/home/yes/
No_Directory="home/no/
script:
if ; then
sed -i... (8 Replies)
Discussion started by: nikki1200
8 Replies
7. Shell Programming and Scripting
Hello All,
I am in the process of learning perl.I have a perl script and based on the arguments passed it would the appropriate subroutine that is defined in the script.
Now, I need to check a value that is defined in the Environment variables and should call the subroutine only if the... (1 Reply)
Discussion started by: filter
1 Replies
8. Shell Programming and Scripting
Hi All,
I am using below if condition to check whether null is passed as a parameter to the program
if or ;
then
echo "ABC">>$FILE
else
echo "CDF">>$FILE
fi
However it is saying me null=null command not found . Please help me with this (9 Replies)
Discussion started by: Hypesslearner
9 Replies
9. Shell Programming and Scripting
Hi All,
Seeking for your assistance on how to condition it correctly.
cat file1.txt
290,1663,43,888,0,0.00,86.91,0.00,26.98,0.00
290,1663,52,0,0,0.00,0.00,0.00,0.00,0.00
290,1663,52,888,0,0.00,34.60,0.00,9.00,0.00
1st scenario:
if the fourth column contains 888s and 0s it is by... (16 Replies)
Discussion started by: znesotomayor
16 Replies
LEARN ABOUT HPUX
xtseteventdispatcher
XtSetEventDispatcher(3X) XT FUNCTIONS XtSetEventDispatcher(3X)
NAME
XtSetEventDispatcher - extension event handling
SYNTAX
XtEventDispatchProc XtSetEventDispatcher(display, event_type, proc)
Display *display;
int event_type;
XtEventDispatchProc proc;
ARGUMENTS
display Specifies the display.
event_type
Specifies the event type.
proc Specifies the proc.
DESCRIPTION
The XtSetEventDispatcher function registers the event dispatcher procedure specified by proc for events with the type event_type. The pre-
viously registered dispatcher (or the default dispatcher if there was no previously registered dispatcher) is returned. If proc is NULL,
the default procedure is restored for the specified type.
In the future, when XtDispatchEvent is called with an event of event_type, the specified proc (or the default dispatcher) will be invoked
to determine a widget to which to dispatch the event.
SEE ALSO
XtEventDispatchProc(3X) XtGetKeyboardFocusWidget(3X) XtInsertEventTypeHandler(3X), XtRemoveEventTypeHandler(3X), XtRegisterExtensionSelec-
tor(3X), XtDispatchEventToWidget(3X)
X Version 11 Release 6 XtSetEventDispatcher(3X)