Ok, I'm stumped and can't seem to find relevant info.
(I'm not even sure, I might have asked something similar before.):
I'm trying to use shell scripting/UNIX commands to extract URLs from a fairly large web page, with a view to ultimately wrapping this in PHP with exec() and including the... (2 Replies)
hi all,
i need an urgent help for writing a shell script which will extract out and print a substring which is the shortest substring from the given string where first and last character of that substring will be given by the user.
for e.g.
if str="abcdpqracdpqaserd"
now if the user gives 'a'... (18 Replies)
Suppose I have a text file that contains the tags <foo> and <bar>. The text file can have unlimted occurances of <foo> and <bar> and looks somthing like this:
<foo>
Some
Text
<foo>
Some
Text
<bar>
Some
Text
<foo>
Some (1 Reply)
How to extract the last character of a string in bash?
---------- Post updated at 03:56 PM ---------- Previous update was at 03:55 PM ----------
Suppose "abcde" is a string. i want to extract the last character i.e. "e". (1 Reply)
Hi awk and sed gurus,
Please help me in the following.
I have the following entries in the file
ABCDErules
AbHDPrules
ABCrules
--
--
and other entries in the file.
Now, I want to extract from the file that contain entries for *rules and process it separately.
How can i do it... (6 Replies)
Hi,
I would like to extract a substring from a string in unix.
eg:
./checkfile.sh -- i need only checkfile.sh from this string.
Could someone help me out in this...
Regards
Arun (19 Replies)
Hi All,
Was wondering how I can do the following....
I have a String as follows
"ACCTRL000005022RRWDKKEEDKDD...."
This string can be in a file called tail.out or in a Variable called $VAR2
Now I have another variable called $VAR1="000004785" (9 bytes long), I need the content of... (5 Replies)
Hi,
I have string in variable like '/u/dolfin/in/DOLFIN.PRL_100.OIB.TLU.001.D20110520.T040010'
and i want to conevrt this string into only "DOLFIN.PRL_100.OIB.TLU.001.D20110520.T040010" (i.e file name).
Is there any command to extracting string in some part ?(rather than whole path)?
... (5 Replies)
Hi,
I am new to Unix. I am trying to extract a substring from an input string: Ex -
input string: deploy_v11_9_1
i want to extract and store the value v11_9_1 from the input string in a new variable.
I am using following command in my shell script file:
echo "Enter the folder name u... (5 Replies)
Hello.
First best wishes for everybody.
here is the input file ("$INPUT1") contents :
BASH_FUNC_message_begin_script%%=() { local -a L_ARRAY;
BASH_FUNC_message_debug%%=() { local -a L_ARRAY;
BASH_FUNC_message_end_script%%=() { local -a L_ARRAY;
BASH_FUNC_message_error%%=() { local... (3 Replies)
Discussion started by: jcdole
3 Replies
LEARN ABOUT PHP
getrusage
GETRUSAGE(3) 1 GETRUSAGE(3)getrusage - Gets the current resource usagesSYNOPSIS
array getrusage ([int $who])
DESCRIPTION
This is an interface to getrusage(2). It gets data returned from the system call.
PARAMETERS
o $who
- If $who is 1, getrusage will be called with RUSAGE_CHILDREN.
RETURN VALUES
Returns an associative array containing the data returned from the system call. All entries are accessible by using their documented field
names.
EXAMPLES
Example #1
getrusage(3) example
<?php
$dat = getrusage();
echo $dat["ru_nswap"]; // number of swaps
echo $dat["ru_majflt"]; // number of page faults
echo $dat["ru_utime.tv_sec"]; // user time used (seconds)
echo $dat["ru_utime.tv_usec"]; // user time used (microseconds)
?>
CHANGELOG
+--------+---------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------+
| 7.0.0 | |
| | |
| | This function is now supported on Windows. |
| | |
+--------+---------------------------------------------+
NOTES
Note
On Windows getrusage(3) will only return the following members:
o "ru_stime.tv_sec"
o "ru_stime.tv_usec"
o "ru_utime.tv_sec"
o "ru_utime.tv_usec"
o "ru_majflt" (only if $who is RUSAGE_SELF)
o "ru_maxrss" (only if $who is RUSAGE_SELF)
If getrusage(3) is called with $who set to 1 ( RUSAGE_CHILDREN), then resource usage for threads are collected (meaning that inter-
nally the function is called with RUSAGE_THREAD).
Note
on BeOS 2000, only the following members are returned:
o "ru_stime.tv_sec"
o "ru_stime.tv_usec"
o "ru_utime.tv_sec"
o "ru_utime.tv_usec"
SEE ALSO
Your system's man page on getrusage(2).
PHP Documentation Group GETRUSAGE(3)