Using unix time function in QShell

I'm trying to create a QShell command to output the time taken to complete a task. My command seems fine when I run it in cygwin, but doesn't produce anything in QShell. For example, this is the command I'd use to get the real time for ls

(time ls) 2>&1 | grep real | cut -f2 >> log.txt

Am I missing something here?

Answers


QSH is a Unix-like environment. There are some oddities surrounding redirection. IBM have a document called Redirecting Output in Qshell that goes over this in brief. I found the following to work, if clunky:

{ time ls *.txt; } > /dev/null 2> time.txt; grep real time.txt | cut -c10-20 >> log.txt; rm time.txt

I couldn't get STDERR redirected without going to a file.


Need Your Help

Is it possible invoke telerik radgrid.databind() from javascript function?

javascript ajax data-binding telerik-grid rad-controls

Im working in asp .net and I have a aspx page with a telerik radgrid. Is it possible invoke radgrid.databind() from a javascript function?

Heroku and Rails issue; database not working in production mode

database heroku ruby-on-rails-4

I'm having an issue when deploying my app to Heroku. The page works flawlessly in local mode (localhost:3000), but when I visit the same page with heroku, I get a "We're sorry, but something went w...