I'm trying to have a loop print out statistics every X number of seconds. How can I add a specific number of seconds to a time variable and make a comparison? Thanks ahead of time.
For example:
startTime = `date +%H%M%S`
currentTime = $startTime
executeTime = startTime + X # X is equal... (5 Replies)
hi i have a script that is taking the difference of multiple columns in a file from a value from a single row..so far i have a loop to do that.. all the data is floating point..fin has the difference between array1 and array2..array1 has 700 x 300= 210000 values and array2 has 700 values..
... (11 Replies)
HI
i have following problem,
i need to use split command to split files each should be cca 700 lines but i dont know how to inplement it in the scripts becasuse each time the origin file will be various size ,
any body got any idea
cheers (2 Replies)
Hi guys,
I need for the bash code below a little bit help: cat script.sh
#!/bin/bash
5_MYVALUE="test"
echo "$5_MYVALUE"
If I try to run the script, got follow failure:
./script.sh
./script.sh: line 4: 5_MYVALUE=test: command not found
_MYVALUE
My questions are how... (4 Replies)
How to convert string into an integer or number
For example :
% set tim = `date`
% echo $tim
Tue Feb 22 16:25:08 IST 2011
here How to increment time by 10 hrs
like 16+10 , here 16 is a string in date cmd. .. how to convert 16 to an integer and added to a another nimber ?
Thanks... (3 Replies)
Hi,
I have data in the following form:
AB001 10
AB002 9
AB003 9
etc
AB200 5
What I need to do is sum up the second value according to groups of the first, i.e. AB001 to AB030 the total being X, AB031 to AB050 the total being Y etc (there are 5 AB ranges of different sizes). I'm sure... (3 Replies)
i need to do camparisions like the below.
For the case when first=10 and second=9.9 the scripts displays process failed.
I need to be able to convert the values to integer before doing the comparision.
Like 9.9 should be rounded over to 10 before doing comparision.
Please advice how can... (3 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)
Hi,
I am new to shell/bash script. I am trying to run below script
#!/bin/bash
a=0
b=10
if
then
echo "a is equal to be"
else
echo "a is not equal to be"
fi
MAX=10
while
do
echo $a
a='expr $a + 1'
done (1 Reply)
Discussion started by: Mallikgm
1 Replies
LEARN ABOUT OPENSOLARIS
echo
echo(1B) SunOS/BSD Compatibility Package Commands echo(1B)NAME
echo - echo arguments to standard output
SYNOPSIS
/usr/ucb/echo [-n] [argument]
DESCRIPTION
echo writes its arguments, separated by BLANKs and terminated by a NEWLINE, to the standard output.
echo is useful for producing diagnostics in command files and for sending known data into a pipe, and for displaying the contents of envi-
ronment variables.
For example, you can use echo to determine how many subdirectories below the root directory (/) is your current directory, as follows:
o echo your current-working-directory's full pathname
o pipe the output through tr to translate the path's embedded slash-characters into space-characters
o pipe that output through wc -w for a count of the names in your path.
example% /usr/bin/echo "echo $PWD | tr '/' ' ' | wc -w"
See tr(1) and wc(1) for their functionality.
The shells csh(1), ksh(1), and sh(1), each have an echo built-in command, which, by default, will have precedence, and will be invoked if
the user calls echo without a full pathname. /usr/ucb/echo and csh's echo() have an -n option, but do not understand back-slashed escape
characters. sh's echo(), ksh's echo(), and /usr/bin/echo, on the other hand, understand the black-slashed escape characters, and ksh's
echo() also understands a as the audible bell character; however, these commands do not have an -n option.
OPTIONS -n Do not add the NEWLINE to the output.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), echo(1), ksh(1), sh(1), tr(1), wc(1), attributes(5)NOTES
The -n option is a transition aid for BSD applications, and may not be supported in future releases.
SunOS 5.11 3 Aug 1994 echo(1B)