Can anyone help please. I am writing a kourne shell script and I am unsure how to do the following:
I have extracted a time string from a logfile, and I have another time string I want to compare it to to see if it's later than the time I'm comparing with.
i.e. expectedSLA="23:00:00", ... (2 Replies)
okay, I'm a complete beginner, and I keep getting stuck on the syntax here. I want to write a script where I read the current time as minutes and seconds, convert the minutes to seconds, and add the two, then redirect the output to a file. the command takes two arguments, which will also be... (1 Reply)
Yes I know tcsh sucks for scripting and arithmetic but I have to write a script for multiple users and they all use tcsh.
I have this variable that I 'set' with but pulling numbers off of stings with
set STUFF = `grep string file | awk command`
Now I would like to add up the numbers that... (4 Replies)
Hi Friends,
please advise on shell script to add two time stamps
for example :
a=12:32
b=12:00
c=a+b=00:32
please help me to find shell script to add to two time stamps, as i need to convert time from EST to GMT or SST to prepare status of jobs in unix and to specify estimated time to... (3 Replies)
Friends,
I have a file with contents like:
interface Serial0/4/0/0/1/1/1/1:0
encapsulation mfr
multilink
group 101
Now I need to manipulate the file in such a way that to all the numbers less than 163, 63 gets added and to all numbers greater than 163, 63 gets deducted.(The numbers... (2 Replies)
Hello all,
I'd like to know how to perform arithmetic on multiple files. I have got many tab-delimited files. Each file contains about 2000 rows and 2000 columns.
What I want to do is to to sum the values in each row & column in every file.
The following explains what I want to do;
... (9 Replies)
I have 2 numbers
xmin = 0.369000018
xmax = 0.569000006
and want to calculate
(xmax- xmin) / 5.0
I have tried using $(( )) but is always giving an error (8 Replies)
I am using bash
I have a script that takes a number, i.e. 85.152, which is always a non integer and essentially tries to get that number to be a multiple of 10. My code is as follows:
number=85.152
A=${number%.*} #Converts float to integer
typeset -i B=$(((A-20)/10)) #subtracting 20 is... (12 Replies)
I found the following issue by simply increasing a variable. The ((A++)) expression returns an error, the other expressions both return 0. Does anyone know why?
script.sh:
#! /bin/bash
A=0
B=0
C=0
((A++)) ; echo "${?}"
((B=B+1)) ; echo "${?}"
((C+=1))... (8 Replies)