3
votes
1answer
60 views

redirect output for a command that takes in multiple arguments

this command is to redirect output of time to with multiple args: $ time wc test >wc.out 2>time.out unix programming environment book shows that the error output of time redirects to ...
9
votes
2answers
428 views

How can I redirect `time` output and command output to the same pipe?

Suppose I have a binary called foo. If I want to redirect the output of foo to some other process bar, I could write ./foo | bar. On the other hand, if I wanted to time foo, and redirect the output ...
0
votes
1answer
51 views

How to measure rlogin time?

I need to monitor the time it takes to rlogin from one HP-UX machine to another. So I wrote this: #!/bin/sh result=`rlogin 10.10.10.1 << EOF exit EOF` result2=`{ time $result >/dev/null; } ...
3
votes
1answer
145 views

CPU is free, yet bash script not utilizing all CPU resources

I ran a simple script to generate a large (10000000 lines) csv file with 6 fields in which some fields changed in each line/row, using a while loop. The machine had all (32) CPUs free, lot of RAM (~31 ...
2
votes
4answers
684 views

how to convert number to time format in shell script?

I want to cut a video into about 10 minute parts like this. ffmpeg -i video.mp4 -ss 00:00:00 -t 00:10:00 -c copy 01.mp4 ffmpeg -i video.mp4 -ss 00:10:00 -t 00:10:00 -c copy 02.mp4 ffmpeg -i video.mp4 ...
1
vote
1answer
94 views

Find if a process terminates in a specific amount of time

I am running a program.Inside this program i run a specific command and i use ulimit command to terminate the running of that command if it exceeds an amount of time.To be more clear i run this: ...
1
vote
1answer
369 views

Getting “zsh: command not found: time” when running `time` in subshell

I installed ZSH (and Oh-My-ZSH) on a Ubuntu 12.10 64 bit machine a few days ago. I just tried to do: time (time ls) and got this error: zsh: command not found: time ( time ls; ) 0.00s user 0.00s ...
4
votes
1answer
2k views

Increase %e precision with /usr/bin/time shell command

When I run the time command in shell time ./myapp I get an output like the following: real 0m0.668s user 0m0.112s sys 0m0.028s However,when I run the command \time -f %e ./myapp I lose ...
6
votes
2answers
5k views

Good method to compare time?

I need to check for the current time and abort the script if it is not proper time of day I am supposed to run it. Also, if anyone else runs it, it should abort. For example: I need my script to only ...
2
votes
1answer
486 views

Execution time of pi calculation in shell scripts

I have to run a couple of command lines on a shell script on Ubuntu, one of those is a pi calculation. It works fine when i run it on terminal via the following cmd line: time echo ...
12
votes
2answers
7k views

How to run time on multiple commands AND write the time output to file?

I want to run time command to measure time of several commands. What I want to do is: Measure the time of running of all of them added together Write the time output to a file Write the STDERR from ...
24
votes
1answer
1k views

Why does echo >file use more real time than echo | sed >file?

The example, below, surprised me. It seems to be counter intuitive... aside from the fact that there is a whisker more user time for the echo | sed combo. Why is echo using so much sys time when it ...
5
votes
4answers
3k views

Convert seconds to well format date

I want to display /proc/uptime in well format as: DD:HH:MM:SS /proc/uptime give me up time of system in seconds, is there a standard solution that convert seconds to this format?