i have an AIX5.3 machine and i am writing a script to display some processes.
inside the script i want to get the time that the process starts and convert it to a unix timestamp.
is there a command that i can use to do that? i search the web but all i found is long scripts and it does not help me.
also note that i cannot use
date -d
command or
mktime
function.
note that i am not asking how to find a command to get the process or the time of the process. i can get the start time of the process the point is to be able to convert the time to a unix timestamp.
Please post an example and explain in detail what you mean by a "unix timestamp".
The best time to record when a process starts is in the script you originally used to start the process.
Reading between the lines, it is quite difficult to work from the output from "ps".
by unix timestamp i mean the following:
when you run the command
date +%s
you have an output of an integer. this integer is the unix timestamp in my case. but also in my script i want to get this output by providing any given date. if i run
date +%s
i get the timestamp of the current date and time. i want to input a time to my script and the script display the timestamp of the time that i provided.