I have a function that is supposed to check for user processes and wait for 0 count before exiting the function. I am sure I have more than one issue in my code, but the stumbling block right now is that I am trying to convert the value of my variable from a string to integer.
process_count needs to be an integer to be evaluated in the while loop but while debugging I see that it is " 0" not "0". Any help will be greatly appreciated!
Hi ...
I am trying to calculate the time needed for a command to execute..
but the resulting value is getting as string..
so i am not able to use "expr " command..
please help me to convert the value to integer so that i can proceed with my script..
Regards
esham (1 Reply)
Hi all,
I'm trying to convert a decimal number into an integer number; I'm doing this:
n=`echo |awk '{ print "'"$mem"'"*10}'`
where the variable mem is equal to 3.7
I'd like to obtain 37, but the expression above gives me 30.
Help please!!!!
thx a lot (4 Replies)
Hi,
I am passing a variable to a unix function.
However when I try to assign the value to another variable like
typeset -i I_CACHE_VAL=$2
Is this because of String to Integer conversion?
I get an error.
Please help me with thsi.
Thanks (2 Replies)
Hi everyone,
I would like to know how to convert an integer to a string. for instance if i=1 i would like to creat a variable called constant1. i want to do this in a for loop so for each value of i, i create a new variable such as constant2, constant3,... and so on.
for i in 1 2 3
do ... (1 Reply)
The shell mentioned below will show a warning if the page takes more than 6 seconds to load.
The problem is that myduration variable is not an integer. How do I convert it to integer?
myduration=$(curl http://192.168.50.1/mantisbt/view.php?id=1 -w %{time_total}) > /dev/null ; ] && echo... (3 Replies)
okay so i run an openssl command to get the date of an expired script. Doing so gives me this:
enddate=Jun 26 23:59:59 2012 GMT
Then i cut everything out and just leave the month which is "Jun"
Now the next part of my script is to tell the user if the the certificate is expired or not... (6 Replies)
Dear community,
i got a problem to get "date +%j" as the right value.
Today is the 10th day of the year.
#./script.sh 2
#!/bin/bash/
Var1=$(date +%j)
Var2=$1
let result=$Var1+$Var2
echo $Var1 plus $Var2 equals $result
The output of the script is:
010 plus 2 equals 10... (9 Replies)
Hi guys,
I'm new here. I have a problem at work. One of our scripts was eventually having a bug and only detected recently. Here's the issue and background:
Bash Script which calls AWK script
Awk script returns a string as per below (example):var1='00000-123'So, when we convert it, the... (18 Replies)
Hello,
How can we convert date like format 20181004171050 in seconds ?
I can able to convert till date but failing for HHMMSS.
date -d "20181004" "+%s" output as 1538596800 .
But when i add hhmmss it is failing date -d "20181004172000" "+%s" result Invalid date
Kindly guide.
Regards (16 Replies)
Discussion started by: sadique.manzar
16 Replies
LEARN ABOUT HPUX
system
system(3S)system(3S)NAME
system() - issue a shell command
SYNOPSIS DESCRIPTION
executes the command specified by the string pointed to by command. The environment of the executed command is as if a child process were
created using (see fork(2)), and the child process invoked the sh-posix(1) utility via a call to (see exec(2)) as follows:
ignores the and signals, and blocks the signal, while waiting for the command to terminate. If this might cause the application to miss a
signal that would have killed it, the application should examine the return value from and take whatever action is appropriate to the
application if the command terminated due to receipt of a signal.
does not affect the termination status of any child of the calling processes other than the process or processes it itself creates.
does not return until the child process has terminated.
APPLICATION USAGE
If the return value of is not -1, its value can be decoded through the use of the macros described in For convenience, these macros are
also provided in
Note that, while must ignore and and block while waiting for the child to terminate, the handling of signals in the executed command is as
specified by fork(2) and exec(2). For example, if is being caught or is set to when is called, the child is started with handling set to
Ignoring and in the parent process prevents coordination problems (such as two processes reading from the same terminal) when the executed
command ignores or catches one of the signals.
RETURN VALUE
If command is null, returns non-zero.
If command is not null, returns the termination status of the command language interpreter in the format specified by wait(2). The termi-
nation status of the command language interpreter is as specified for sh-posix(1), except that if some error prevents the command language
interpreter from executing after the child process is created, the return value from is as if the command language interpreter had termi-
nated using If a child process cannot be created, or if the termination status for the command language interpreter cannot be obtained,
returns -1 and sets to indicate the error.
DIAGNOSTICS
forks to create a child process which, in turn, in order to execute string. If the fork fails, returns -1 and sets If the exec fails,
returns the status value returned by (see wait(2)) for a process that terminates with a call of
ERRORS
If errors are encountered, sets values as described by fork(2).
FILES SEE ALSO sh(1), fork(2), exec(2), wait(2), thread_safety(5).
STANDARDS CONFORMANCE system(3S)