Re: feature: time builtin and file descriptor

2014-10-31 Thread Chet Ramey
On 10/31/14, 5:15 AM, Sami Kerola wrote: On 30 October 2014 20:14, Eduardo A. Bustamante López dual...@gmail.com wrote: Sounds the there is not much enthusiasm about making this sort of feature to work. This proposal belongs to archived never implemented ideas area. Good that effort wasting

Re: feature: time builtin and file descriptor

2014-10-31 Thread Sami Kerola
On 30 October 2014 20:14, Eduardo A. Bustamante López dual...@gmail.com wrote: Sounds the there is not much enthusiasm about making this sort of feature to work. This proposal belongs to archived never implemented ideas area. Good that effort wasting was kept minimal. Remember that working

Re: feature: time builtin and file descriptor

2014-10-31 Thread Eduardo A . Bustamante López
OK. It doesn't sound like this feature is of general interest. Since you can control when you open and close file descriptors, you might look at $SECONDS when the file is opened and when it's closed and using the difference to see how long it was open. If I understand correctly, the

Re: feature: time builtin and file descriptor

2014-10-31 Thread Geir Hauge
2014-10-29 15:09 GMT+01:00 Sami Kerola kerol...@iki.fi: This idea came to my mind while writing a script that runs multiple commands, and I simply wanted to know how long they are busy. I am aware alternatives exist, but they can get a bit tricky if one wants to have multiple measurements

Re: feature: time builtin and file descriptor

2014-10-30 Thread Sami Kerola
On 30 October 2014 01:25, Chet Ramey chet.ra...@case.edu wrote: On 10/29/14 10:09 AM, Sami Kerola wrote: Would it make sense to add to 'time' builtin a way to measure how long a file descriptor is been kept open? Something like this. You can use $SECONDS for this, but you have to do the math

feature: time builtin and file descriptor

2014-10-29 Thread Sami Kerola
Hello, Would it make sense to add to 'time' builtin a way to measure how long a file descriptor is been kept open? Something like this. -- snip #!/bin/bash exec 420 time --file-descriptor 42 sleep 10 exec 42- -- snip $ ./above_script.sh real0m10.012s user0m0.000s sys 0m0.000s This

Re: feature: time builtin and file descriptor

2014-10-29 Thread Greg Wooledge
On Wed, Oct 29, 2014 at 02:09:53PM +, Sami Kerola wrote: Would it make sense to add to 'time' builtin a way to measure how long a file descriptor is been kept open? Doesn't really make much sense. If you want multiple independent timers, there's no reason to tie them to open file

Re: feature: time builtin and file descriptor

2014-10-29 Thread Chet Ramey
On 10/29/14 10:09 AM, Sami Kerola wrote: Hello, Would it make sense to add to 'time' builtin a way to measure how long a file descriptor is been kept open? Something like this. You can use $SECONDS for this, but you have to do the math and keep track of the file descriptors yourself. Chet