05-19-2010
Thanks JGT.
I supoose that your way might be more correct. But that part of the code is actually working.
Beacuse if I put in numbers higher or lower than 300000 i get the results that I want.
My focus is on solving the comparision of the character string that is failing
and as a secondary effect gives the
> 300000 : syntax error
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi all,
i am new to unix. Actually i need to compare two string and print the result...
suppose type='sun'
if; then
echo good morning
else
echo good night
fi
whether the comparison is right r we need to use eq????
help me please.... :confused:
thanks in advance.... (1 Reply)
Discussion started by: ithirak17
1 Replies
2. Shell Programming and Scripting
Hi all,
I am trying to compare two strings/dates, but its throwing error::Syntax error at line 5:
Please help !!
Any alternate way to compare two dates is also fine....
logdate1=`date -u '+%Y.%m.%d %T'`
sleep 5
logdate2=`date -u '+%Y.%m.%d %T'`
if test... (5 Replies)
Discussion started by: prashant43
5 Replies
3. Shell Programming and Scripting
Hi,
Would anyone know how to compare two strings, and only throw an error if there were different words, not that the same words were in a different order?
e.g
"A B C" vs "B C A" ->OK
"A B C" vs "A D C" -> BAD
Thanks! (2 Replies)
Discussion started by: rebelbuttmunch
2 Replies
4. Shell Programming and Scripting
Hi,
Here is my script
#!/bin/ksh
echo $pick_typ
if ];then
echo "inside if"
else
echo "outside if"
fi
when ever i pass CUS as parameter to this script am getting the correct value CUS, however if i pass ORD as parameter it is not coming inside if it is echoing else "Outside... (12 Replies)
Discussion started by: bhargav20
12 Replies
5. Shell Programming and Scripting
Hello , I want to Compare with 2 strings and get if they are True or not
please would like some help on this
#!bin/ksh
echo "Enter Name 1"
read Name1
echo "Enter Name 2"
read Name2
echo "------------------------"
echo "First Name: $Name1"
echo "Second Name: $Name2"
echo... (25 Replies)
Discussion started by: shatztal
25 Replies
6. Shell Programming and Scripting
hi..
i have a problem to compare two string
my code is like that
if ]
then
echo "both data are correct"
elif ]
echo "data is wrong"
fi
here $username1 is taking value from file.. (7 Replies)
Discussion started by: shubhig15
7 Replies
7. Shell Programming and Scripting
hello guyzz
please help me out..
I have two file a.sh and b.sh it contains two string SD109 ,SD108 .
I want to compaere these two string .
If a.sh>b.sh
do rebasing
record time.
else it shows no rebasing required.
Thanks. (2 Replies)
Discussion started by: abhijtr
2 Replies
8. Shell Programming and Scripting
I have 2 values V_1_4_4_b1 and V_1_5_1_RC_b1. I would need to compare them and determine if the 1st value is greater, less or equal
than the 2nd value. The result should need to have a return value.
I have below code in bash function but it seems it is not comparing it correctly. Any help will... (8 Replies)
Discussion started by: aderamos12
8 Replies
9. UNIX for Beginners Questions & Answers
Hi,
I am trying to do the following to see if "ip" is already present in a file.
if ; then
echo "hi"
else
echo "hello"
fi
I am seeing errors on the if statement. Can someone please correct the syntax for me? Thanks (2 Replies)
Discussion started by: waince
2 Replies
10. Ubuntu
I think there is a way to detect mouse movement.
valuator changes if the mouse moves.
So I need to compare the two strings.
Not sure how to do that.
How could I send the valuator string to a file ?
I would need to do it twice.
andy@7_~/Downloads$ xinput query-state 9
2 classes :... (7 Replies)
Discussion started by: drew77
7 Replies
LEARN ABOUT OSF1
xsetinputfocus
XSetInputFocus(3X11) XSetInputFocus(3X11)
NAME
XSetInputFocus, XGetInputFocus - control input focus
SYNOPSIS
XSetInputFocus(display, focus, revert_to, time)
Display *display;
Window focus;
int revert_to;
Time time;
XGetInputFocus(display, focus_return, revert_to_return)
Display *display;
Window *focus_return;
int *revert_to_return;
ARGUMENTS
Specifies the connection to the X server. Specifies the window, PointerRoot, or None. Returns the focus window, PointerRoot, or None.
Specifies where the input focus reverts to if the window becomes not viewable. You can pass RevertToParent, RevertToPointerRoot, or Revert-
ToNone. Returns the current focus state (RevertToParent, RevertToPointerRoot, or RevertToNone). Specifies the time. You can pass either a
timestamp or CurrentTime.
DESCRIPTION
The XSetInputFocus function changes the input focus and the last-focus-change time. It has no effect if the specified time is earlier than
the current last-focus-change time or is later than the current X server time. Otherwise, the last-focus-change time is set to the speci-
fied time (CurrentTime is replaced by the current X server time). XSetInputFocus causes the X server to generate FocusIn and FocusOut
events.
Depending on the focus argument, the following occurs: If focus is None, all keyboard events are discarded until a new focus window is set,
and the revert_to argument is ignored. If focus is a window, it becomes the keyboard's focus window. If a generated keyboard event would
normally be reported to this window or one of its inferiors, the event is reported as usual. Otherwise, the event is reported relative to
the focus window. If focus is PointerRoot, the focus window is dynamically taken to be the root window of whatever screen the pointer is
on at each keyboard event. In this case, the revert_to argument is ignored.
The specified focus window must be viewable at the time XSetInputFocus is called, or a BadMatch error results. If the focus window later
becomes not viewable, the X server evaluates the revert_to argument to determine the new focus window as follows: If revert_to is RevertTo-
Parent, the focus reverts to the parent (or the closest viewable ancestor), and the new revert_to value is taken to be RevertToNone. If
revert_to is RevertToPointerRoot or RevertToNone, the focus reverts to PointerRoot or None, respectively. When the focus reverts, the X
server generates FocusIn and FocusOut events, but the last-focus-change time is not affected.
XSetInputFocus can generate BadMatch, BadValue, and BadWindow errors.
The XGetInputFocus function returns the focus window and the current focus state.
DIAGNOSTICS
Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the
full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. A value for
a Window argument does not name a defined Window.
SEE ALSO
XWarpPointer(3X11)
Xlib -- C Language X Interface
XSetInputFocus(3X11)