Hi Im trying to write a script that compare a text string.
But it fails, I think it adds a extra line feed to the result and fails beacuse of that.
The script.
The result is as follows
If the ntp server is available it returns a number
It fails doing the comparision I dont understand why.
Why is there a blank line below
Thanks.
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)
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)
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)
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)
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)
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)
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)
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)
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)
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 SUSE
tnm::ntp
ntp(n) Tnm Tcl Extension ntp(n)
__________________________________________________________________________________________________________________________________________________NAME
ntp - Retrieve NTP status information.
_________________________________________________________________DESCRIPTION
The Network Time Protocol (NTP) (RFC 1119, RFC 1305) allows to synchronize computer clocks by exchanging NTP messages. The ntp command
allows to retrieve control variables from NTP peers.
NTP COMMAND
ntp [options]
Invoking the ntp command with options but without any command arguments allows to retrieve and change the default values. See the
description of supported options below. Default values are bound to a Tcl interpreter which allows to have multiple Tcl interpreter
with different defaults.
ntp [options] host arrayName
The ntp command sends a NTP version 3 mode 6 request to host and writes status information into the Tcl array arrayName. After suc-
cessful completion, the array will contain the following elements (RFC 1305):
peer.delay
This is a signed fixed-point number indicating the roundtrip delay of the peer clock relative to the local clock over the
network path between them, in seconds.
peer.dispersion
This is a signed fixed-point number indicating the maximum error of the peer clock relative to the local clock over the net-
work path between them, in seconds.
peer.offset
This is a signed, fixed-point number indicating the offset of the peer clock relative to the local clock, in seconds.
peer.precision
This is a signed integer indicating the precision of the various clocks, in seconds to the nearest power of two.
peer.reach
This is a shift register used to determine the reachability status of the peer, with bits entering from the least significant
(rightmost) end. A peer is considered reachable if at least one bit in this register is set to one.
peer.srcadr
This is the IP address of the peer.
peer.stratum
This is an integer indicating the stratum of the local clock.
peer.valid
This is an integer counter indicating the valid samples remaining in the filter register. It is used to determine the reacha-
bility state and when the poll interval should be increased or decreased.
sys.peer
This is a selector identifying the current synchronization source.
sys.precision
This is a signed integer indicating the precision of the various clocks, in seconds to the nearest power of two.
sys.refid
This is a 32-bit code identifying the particular reference clock.
sys.rootdelay
This is a signed fixed-point number indicating the total roundtrip delay to the primary reference source at the root of the
synchronization subnet, in seconds.
sys.rootdispersion
This is a signed fixed-point number indicating the maximum error relative to the primary reference source at the root of the
synchronization subnet, in seconds.
sys.stratum
This is an integer indicating the stratum of the local clock
sys.system
A textual description of the system type.
NTP OPTIONS
The following options control how NTP requests are send and how the ntp command deals with lost NTP packets.
-timeout time
The -timeout option defines the time the ntp command will wait for a response. The time is defined in seconds with a default of 2
seconds.
-retries number
The -retries option defines how many times a request is retransmitted during the timeout interval. The default number of retries is
2.
SEE ALSO scotty(1), Tnm(n), Tcl(n)
AUTHORS
Erik Schoenfelder <schoenfr@gaertner.de>
Juergen Schoenwaelder <schoenw@cs.utwente.nl>
Tnm ntp(n)