Hi,
I need to extract only a part of the filenames of some files. The files are named this way :
.tap_profile_SIT02
I want the "SIT02" part, which is not the same for each file. I was able to get what I want with bash, but not with ksh. Here is the command I used in bash :
find... (8 Replies)
I like to have the date in the 2008-09-01 format at the beginning of my filenames. I then hyphenate after that and then have my filename.
I have a script that creates this for me. However, I may be working on files that already have the date format already in there and so I don't want to have a... (4 Replies)
Hi,
I have this file name : xxx.77876767575.abc.77887.iiii
If to get only the xxx i will need to do this command:
i=xxx.77876767575.abc.77887.iiii
name=`echo $i |cut -f1 -d "."`
How do i get 77876767575.abc.77887.iiii without xxx in front?
Please advice.
Thanks (7 Replies)
I've many file like this
01-file
01_-_file
01_-_file
01_-_file
01_-_file
01-file
I would remove bold part from filename. Suggestions?Thanks (4 Replies)
I need a small script (sh) to remove in a variable the filename extension.
Example:
f = "testfile.txt"
and I need a $a with "testfile".
Some one a idea? (4 Replies)
Hi All,
I'm trying to get part of a filename and my skill with regular expression are lacking. I know I need to use SED but have no idea how to use it. I'm hoping that someone can help me out. The file names would be:
prefix<partwewant>suffix.extension
the prefix and suffix are always 3... (4 Replies)
Hi All,
Thanks in Advance
I am working on a shell script. I need some assistance.
My Requirement:
1) There are some set of files in a directory like given below
OTP_UFSC_20120530000000_acc.csv
OTP_UFSC_20120530000000_faf.csv
OTP_UFSC_20120530000000_prom.csv... (0 Replies)
Hi All,
Thanks in Advance
I am working on a shell script. I need some assistance.
My code:
if
then
set "subscriber" "promplan" "mapping" "dedicatedaccount" "faflistSub" "faflistAcc" "accumulator"\
"pam_account";
for i in 1 2 3 4 5 6 7 8;... (0 Replies)
Hi ,
I've the following file names and i need the part of the file name
The files are like below
FN_DATE_TODAY_20010178654321.txt
FN_DATE_LASTDAY_19990178654321.txt
and i need to cut the filenames like below
FN_DATE_TODAY
FN_DATE_LASTDAY
How can i achieve that
Thanks (5 Replies)
Hi guys!
I have quite a lot of files like
all_10001_ct1212307460308.alf*
and I want to get rid of the first number for all at once like:
all_ct1212307460308.alf*
How can I do this in the shell? (12 Replies)
Discussion started by: TimmyTiz
12 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)