09-17-2012
Hey guys, thanks all for your replies!
Cool I'll give these a shot and post back...
EDIT:
What I'm doing is this,,, When I run the 'ps' command and I'm looking for a particular process that's running, sometimes there
are multiple instances running of this same process and say for instance 2 of the processes started a day or 2 ago, but that's
all they tell you is the date it started (i.e. the 'ps' command's "STIME"). So what I did was I run "ps -eo pid,etime,cmd" and I get the
elapsed time of the process.
The output of the elapsed column looks like "2-21:44:05", meaning it started 2 days, 21 hours, 44min, and 5 seconds ago. I then use
the time variables from this ETIME column in the output of 'ps' and calculate the other variables I need and feed them into Perl's timelocal
Function with ($sec, $min, $hour, $mday, $month, $year) in order to get a UNIX timestamp for a past date and time.
Thanks Again,
Matt
Last edited by mrm5102; 09-17-2012 at 11:14 AM..
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Discussion started by: r1500
2 Replies
2. UNIX for Dummies Questions & Answers
Hi ,
I have a peculiar case, where my sed command is working on a file which contains lines of small length.
sed "s/XYZ:1/XYZ:3/g" abc.txt > xyz.txt
when abc.txt contains lines of small length(currently around 80 chars) , this sed command is working fine.
when abc.txt contains lines of... (3 Replies)
Discussion started by: thanuman
3 Replies
3. UNIX for Dummies Questions & Answers
Hi Guys,
Could anyone shed some light on the length of a Unix filepath max length pls ?
thanks !
Wilson (3 Replies)
Discussion started by: wilsontan
3 Replies
4. UNIX for Dummies Questions & Answers
I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies
5. Shell Programming and Scripting
Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types:
(H)eader Records
(D)etail Records
(T)railer Records
The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies
6. Shell Programming and Scripting
Hi,
Can anyone help with a effective solution ?
I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces.
The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies
7. Shell Programming and Scripting
Hello Everyone,
I'm running AIX 5.3 and need to generate a 100 character fixed length empty file from within a bash script that I am developing.
I searched and was able to find:
dd if=/dev/zero of=/test/path/file count=100
however my understanding is that this will generate a file of a... (10 Replies)
Discussion started by: jvt
10 Replies
8. Shell Programming and Scripting
Hello Everyone,
I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table.
Input Data-
------ ------------------------ ---- -----------------
WFI001 Xxxxxx Control Work Item A Number of Records
------ ------------------------... (5 Replies)
Discussion started by: sonali.s.more
5 Replies
9. Shell Programming and Scripting
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
LEARN ABOUT PHP
http_parse_message
HTTP_PARSE_MESSAGE(3) 1 HTTP_PARSE_MESSAGE(3)
http_parse_message - Parse HTTP messages
SYNOPSIS
object http_parse_message (string $message)
DESCRIPTION
Parses the HTTP $message into a simple recursive object.
PARAMETERS
o $message
- string containing a single HTTP message or several consecutive HTTP messages
RETURN VALUES
Returns a hierarchical object structure of the parsed messages.
EXAMPLES
Example #1
Using http_parse_message(3)
<?php
define ('URL', 'http://www.example.com/');
print_r(http_parse_message(http_get(URL, array('redirect' => 3))));
?>
The above example will output something similar to:
stdClass object
(
[type] => 2
[httpVersion] => 1.1
[responseCode] => 200
[headers] => Array
(
[Content-Length] => 3
[Server] => Apache
)
[body] => Hi!
[parentMessage] => stdClass object
(
[type] => 2
[httpVersion] => 1.1
[responseCode] => 302
[headers] => Array
(
[Content-Length] => 0
[Location] => ...
)
[body] =>
[parentMessage] => ...
)
)
SEE ALSO
http_parse_headers(3), the HttpMessage class.
PHP Documentation Group HTTP_PARSE_MESSAGE(3)