I have searched and found a few threads that have dealt with this, but the examples I've tried haven't seemed to help.
I am monitoring our database log for high checkpoints.
I can parse out the checkpoint value which can be anywhere from zero into a 3 digit number.
I set a variable to be the... (3 Replies)
Script
#!/bin/sh
hardware=PC
os=WindowsNET
for i in `cat newservers`
do
x=`sudo /opt/openv/netbackup/bin/admincmd/bpplclients |grep $i |head -40 |grep $i|awk '{print $3;exit}'`
if
then
echo "$i is already added"
else
echo "Need to add"
fi
done
O/p in debug mode
bash-2.05$... (3 Replies)
I have two computers with dynamic IP addresses and am using dyndns so that they are identifiable as the same computer even if their IPs change (we'll call them host1.dyndns.com and host2.dyndns.com). I also have a remote server which I would like to store my computers' IP addresses on. There is a... (9 Replies)
Hi.
I have three arrays.
@a=('AB','CD','EF');
@b=('AB,'DG',HK');
@c=('DD','TT','MM');
I want to compare the elements of the first two array and if they match then so some substition.
I tried using the if statement using the scalar value of the array but its not giving me any output.
... (7 Replies)
im trying to compare ipaddresses. i loop through an array to see if the ip is already is in the array and if it is it should set a flag and then i wont add it to the array. but its just adding all the ipaddresses to the array
if ]
then
... (3 Replies)
I'm writing a shellscript that monitors the price of a watch. If the prices changes, it should email me. The body of the email will show the old price and the new price. However when I compare the two awk variables(oldprice and newprice) it always says they're not the same. The shellscript goes out... (2 Replies)
Hi!
I've come up with a ksh-script that produces one or more lists of hosts.
At the and of the script, I would like to print only those hosts that exists in all the lists.
Ex.
HOSTS="host1 host2 host3 host11"
HOSTS="host1 host2 host4"
HOSTS="host2 host11"
HOSTS="host2 host5 host6 host7... (1 Reply)
Is there a way to compare variables in a 'awk'?
I've been trying for a while and can't figure it out. I'm guessing its not possible :/
VAR=Bob
awk '$3 == $VAR { print $1 }' file.txt
Regards
Jikuu (4 Replies)
Hi there
this script is an atempt to define which instances of Jboss relate to its PID by the date and timestamp I am using calc to test with. On our system the only way you can tell which instance relates to a particular instance is by looking at the start up time and date in a log.
The... (9 Replies)
I have a script like this. Just couldn't get the comparison part work. Any thought? thanks,
#!/usr/bin/ksh -x
STEP=`echo $(basename $0 .ksh) | tr "" ""`
log=/skip.log
while read LINE
do
if
then
echo `date`: STEP $STEP skipped by user >> $log
exit 0
fi
done < $1
echo... (0 Replies)
Discussion started by: ghostmic
0 Replies
LEARN ABOUT OPENDARWIN
tcl_gettime
Tcl_GetTime(3) Tcl Library Procedures Tcl_GetTime(3)__________________________________________________________________________________________________________________________________________________NAME
Tcl_GetTime - get date and time
SYNOPSIS
#include <tcl.h>
Tcl_GetTime( timePtr )
ARGUMENTS
Tcl_Time * timePtr (out) Points to memory in which to store the date and time information.
_________________________________________________________________DESCRIPTION
The Tcl_GetTime function retrieves the current time as a Tcl_Time structure in memory the caller provides. This structure has the follow-
ing definition:
typedef struct Tcl_Time {
long sec;
long usec;
} Tcl_Time;
On return, the sec member of the structure is filled in with the number of seconds that have elapsed since the epoch: the epoch is the
point in time of 00:00 UTC, 1 January 1970. This number does not count leap seconds - an interval of one day advances it by 86400 seconds
regardless of whether a leap second has been inserted.
The usec member of the structure is filled in with the number of microseconds that have elapsed since the start of the second designated by
sec. The Tcl library makes every effort to keep this number as precise as possible, subject to the limitations of the computer system. On
multiprocessor variants of Windows, this number may be limited to the 10- or 20-ms granularity of the system clock. (On single-processor
Windows systems, the usec field is derived from a performance counter and is highly precise.)
SEE ALSO
clock
KEYWORDS
date, time
Tcl 8.4 Tcl_GetTime(3)