I am trying to get timing paramters from a CGI program. date is just a command for example used here. when I do: time { date; } everything is good. when I do: time -o file { date; } I get time -o file { date; } bash: syntax error near unexpected token `}' How do I correctly issue the command with an option for -o file to output the data to a file. Thanks, Jerry
On Tue, Jan 13, 2009 at 9:14 AM, Jerry Geis <geisj at pagestation.com> wrote:> I am trying to get timing paramters from a CGI program. > date is just a command for example used here. > > when I do: time { date; } > everything is good. > > when I do: time -o file { date; } > I get > time -o file { date; } > bash: syntax error near unexpected token `}' > > How do I correctly issue the command with an option > for -o file to output the data to a file.The man page for time gives the usual information and includes only the -p option, but then, below the 'see also' section which usually signifies the end, it goes on to discuss the 'GNU version' which includes additional options. Apparently, the time command we get with CentOS is not the GNU version because it pukes on all of the stated options. So why is all that info in the man page and where is this elusive GNU version? I checked both C4 and C5 and neither supported the additional options. Unless somebody else can shed some more light on this, I guess you are stuck with output redirection provided by your chosen shell. -- Jeff
On Tue, Jan 13, 2009, Jerry Geis wrote:>I am trying to get timing paramters from a CGI program. >date is just a command for example used here. > >when I do: time { date; } >everything is good. > >when I do: time -o file { date; } >I get > time -o file { date; } >bash: syntax error near unexpected token `}' > >How do I correctly issue the command with an option >for -o file to output the data to a file.Why aren't you using standard i/o redirection? time { date ; } > file OR to append to the file time { date ; } >> file Bill -- INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way Voice: (206) 236-1676 Mercer Island, WA 98040-0820 Fax: (206) 232-9186 Breathe fire, slay dragons, and take chances. Failure is temporary, regret is eternal.