PMPARSEINTERVAL(3) Library Functions Manual PMPARSEINTERVAL(3)NAME
pmParseInterval - convert interval string to timeval structure
C SYNOPSIS
#include <pcp/pmapi.h>
int pmParseInterval(const char *string, struct timeval *rslt, char **errmsg);
cc ... -lpcp
DESCRIPTION
pmParseInterval parses the argument string specifying an interval of time and fills in the tv_sec and tv_usec components of the rslt struc-
ture to represent that interval.
The input string is most commonly the argument following a -t command line option to a PCP application, and the syntax is fully described
in PCPIntro(1).
pmParseInterval returns 0 and errmsg is undefined if the parsing is successful.
If the given string does not conform to the required syntax pmParseInterval returns -1 and a dynamically allocated error message string in
errmsg. The error message is terminated with a newline and includes the text of the input string along with an indicator of the position
at which the error was detected, e.g.
4minutes 30mumble
^ -- unexpected value
In the case of an error, the caller is responsible for calling free(3C) to release the space allocated for errmsg.
SEE ALSO PMAPI(3) and pmParseTimeWindow(3).
Performance Co-Pilot PCP PMPARSEINTERVAL(3)
Check Out this Related Man Page
PMPARSETIME(3) Library Functions Manual PMPARSETIME(3)NAME
__pmParseTime - parse time point specification
C SYNOPSIS
#include <pcp/pmapi.h>
#include <pcp/impl.h>
int __pmParseTime(const char *string, struct timeval *logStart, struct timeval *logEnd, struct timeval *rslt, char **errMsg);
cc ... -lpcp
DESCRIPTION
__pmParseTime is designed to encapsulate the interpretation of a time point specification in command line switches for use by the PCP
client tools.
This function expects to be called with the time point specification as string. If the tool is running against PCP archive(s), you also
need to supply the start time of the first (only) archive as logStart, and the end of the last (only) archive as logEnd. See pmGetArchive-
Label(3) and pmGetArchiveEnd(3) for how to obtain values for these parameters. If the tool is running against a live feed of performance
data, logStart should be the current time (but could be aligned on the next second for example), while logEnd should have its tv_sec compo-
nent set to INT_MAX.
The rslt structure must be allocated before calling __pmParseTime.
You also need to set the current PCP reporting time zone to correctly reflect the -z and -Z command line parameters before calling __pm-
ParseTime. See pmUseZone(3) and friends for information on how this is done.
If the conversion is successful, __pmParseTime returns 0, and fills in rslt with the time value defined by the input parameters. If the
argument strings could not be parsed, it returns -1 and a dynamically allocated error message string in errMsg. Be sure to free(3C) this
error message string.
SEE ALSO PMAPI(3), pmGetArchiveEnd(3), pmGetArchiveLabel(3), pmNewContextZone(3), pmNewZone(3), pmParseInterval(3), pmParseTimeWindow(3), pmUse-
Zone(3), __pmConvertTime(3) and __pmParseCtime(3).
Performance Co-Pilot PCP PMPARSETIME(3)
Can anyone tell me why I keep on getting this error message?
../dosRename: syntax error at line 77: `end of file' unexpected
I have treid everything and I just can get it to work!
Here is the code:
#!/bin/sh
Usage() {
&& echo "\n$*\n" >&2
cat <<-EOD_USAGE >&2
Usage:... (4 Replies)
Hi,
I had this syntax and no matter what I do, I can't get it run.
err message:
run6: syntax error at line 121 : `(' unexpected
I went to line 121 and it's comment out!
All the variables passed to nawk are valid.
There are two places I suspect have the problem:
1.... (3 Replies)
I am trying to run the script bellow but its given me "syntax error at line 20 :'done' unexpected." error message"
can someone check to see if the script is ok? and correct me pls.
Today is my first day with scripting.
Gurus should pls help out
#!/bin/ksh
# Purpose: Check to see if file... (3 Replies)
A newbie in scripting is trying to run the script bellow but keep getting an error message ;
syntax error at line 76 : `<<' unmatched
what we have on that area pointed to is highlighted in red bellow:
##################################################
fi
# Memory Performance (vmstat -... (5 Replies)
./sample.5: syntax error: `(' unexpected
I get this error and Im trying to solve it but the line that it refering to is a notation so I don't understand why it is affecting the program. (2 Replies)
Hi Guys,
I have a following code in cm1.sh script.
cnt=`sqlplus -s <un>/<pwd> << !EOF
set heading off verify off pagesize 0
select count(*) from fnd_svc_components where component_name like '%Mailer%' and component_status != 'RUNNING';
exit;
!EOF`
echo $cnt
if ; then
sqlplus -s... (1 Reply)
I'm getting the following error:
line 21: syntax error near unexpected token `done`
line 21: `done`
and I haven't been able to figure out why.
Here is my code
#!/bin/sh
if ; then
echo 'Usage: rename getexp/replStr '
exit 0
fi
arg = $1
shift
while ; do (5 Replies)
Hi,
i have to find a string in a file and positin of the string in the file would come in some particular interval.
let's say file is 1-1000 lines and string is in from 200-300line.
could any one suggest me how to get make the grep search for the string in that particular portion of the... (4 Replies)
I am trying to run the code below however I am getting a "syntax error near unexpected token `for file in error" on the line that is in red. I have the semicolons after every line because it will fail on the copy if I don't have them saying that it cannot stat directory. Is there something that I... (3 Replies)
Hi Everyone,
my script was running Ok, but suddenly it started giving this error.
./update_env_bi.sh: line 54: syntax error near unexpected token `)'
./update_env_bi.sh: line 54: `sed -i "s/PORT=*1/PORT=$2/" repository.xml'
The line 54 has this code.
sed -i "s/PORT=*1/PORT=$2/"... (2 Replies)