Re: bash scripting question



Paul E Condon wrote:

Try:

bgn=$(date +%s)
sleep 7
end=$(date +%s)
echo "elapsed seconds = " $(( end - bgn ))


You might also want to experiment with:

ps h -o etime $$

as long as you're happy with it only running under gnu. Prints the elapsed time for the shell.

--
Chris Jackson
Shadowcat Systems Ltd.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/4BA3DAE2.7080208@xxxxxxxxxxxxxxx



Relevant Pages

  • thinkpad suspend/resume woes
    ... Check out the new MSN Search! ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: What does this mean?
    ... On Sun, Jul 22, 2012 at 2:58 AM, Paul E Condon ... The computer is running only a home brew data processing script ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Re: SATA disc spindown
    ... This is why I posted the wiki link: the article explains how to create a bootable freedos image with the exe included. ... some disagree because mdraid does not handle it well should one array member sleep and another member doesn't. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: daemonizing a command
    ... I was thinking to use nohup ruby app.rb & at rc.local, ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)
  • Re: howto start something 5 mins after boot
    ... You could create a bootscript that uses the "at" command, ... echo myscript | at now + 5 minutes ... something like this: sleep 300 && ls ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)