12-03-2010
how to avoid time command output
Hi,
I have 2 queries
1 .when I run some unix command, I am getting the output of "time" at std output (screen)
for eg
zegrep <pattern> *.v.gz
I almost found the reason but not sure, if the no of files matching *.v.gz is more then I am getting the time command output at the screen
whereas if i give
zegrep <pattern> design_name.v.gz, I am not getting the time output in my screen
so my question is how to avoid the time command output at my screen when the unix command is working on multiple files
2. similalry when I execute a csh script at the end of the script execution, I am getting the time command output at my screen. how to avoid that too
thanks in advance
Regards,
Selva
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am sending a kill comand to kill a process inside a SH script but I don`t want the user to notice it so I donīt want the message "1222 killed" to appear.
I`ve tried to redirect the standard output to /dev/null 2>&1 and also tried to use "nohup" but none of them was succesfull.
Can anyone... (1 Reply)
Discussion started by: pguinal
1 Replies
2. UNIX for Advanced & Expert Users
can someone tell me the meaning of this commnad,
If you want to see a grand total of CPU time for a program when it finishes running, you can use the time command. At the Unix prompt, enter:
time java myprog
Replace myprog with the name of the program you are running. The following is an... (2 Replies)
Discussion started by: ldpathak
2 Replies
3. Shell Programming and Scripting
Hi i created a cron job which invoke a shell script and output some content via email.
Some times these output are sent to the junk email folder. i want these mails to be sent to inbox with some specific font. what i have to do? (4 Replies)
Discussion started by: vidhyaS
4 Replies
4. Solaris
Hi,
Would like to know the uptime or specific time limit to reboot the sun microsystem to avoid unplanned outage.
Regards,Tarun (9 Replies)
Discussion started by: taruntan
9 Replies
5. Shell Programming and Scripting
I have set up a bash script to run a long list of things that I need to time. I would like to redirect the output of time to a file. I have set it up like,
echo "Runtimes for servlet 4, 100K structures" > test_times.txt
echo "" >> test_times.txt
echo "runs where N=10" >> test_times.txt
echo... (7 Replies)
Discussion started by: LMHmedchem
7 Replies
6. Solaris
Hi All,
I am listing the files which are 4 hours older. For this first I have creted a dummy file with the 4 hours before timestamp, then I am using the below find command,
find /path/ -type f ! -newer 4_hours_oledr_file -exec ls -lrt {} \;
I am getting the files which are older than... (13 Replies)
Discussion started by: velava
13 Replies
7. Shell Programming and Scripting
I am new to shell scripting and wished to get few things clarified.
While calling functions within shell script, output comes out as single line irrespective of the no of echos or newlines I tried within function +
the echo -e used to invoke function ( as instructed online) :
#!/bin/sh
inc() {... (1 Reply)
Discussion started by: RMath
1 Replies
8. Shell Programming and Scripting
F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME COMD
401 S catmgr 5748 5742 0 154 20 e0000006d48cd080 133 e0000003fb6e7200 11:22:32 ? 0:00 /opt/ssh/libexec/sftp-server
3401 R catmgr 5742 5631 0 152 20 e0000005f974fa00 750 ... (4 Replies)
Discussion started by: TomG
4 Replies
9. Shell Programming and Scripting
I am measuring the time it takes for a wget command to complete.
Right now my command is:
time wget https://`ifconfig -a | grep '32.29.120' | cut -d: -f2 | cut -d' ' -f1`:8443/primary-rest/shop?brandId=test --header="name: test" --no-check-certificate -o SELF_TEST.log
The output I get is ... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies
10. Solaris
Hello,
This is Solaris 10 (x86)
bash-3.2# cat /etc/release
Solaris 10 5/09 s10x_u7wos_08 X86
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 30 March... (5 Replies)
Discussion started by: solaris_1977
5 Replies
time(1) General Commands Manual time(1)
NAME
time - Times the execution of a command
SYNOPSIS
time [-p] command [argument...]
The time command prints the elapsed time during the execution of a command, the time spent in the system, and the time spent in execution
of the command on the diagnostic output system.
Note
The C shell has a built-in version of the time command. If you are using the C shell, and want to guarantee that you are using the command
described here, you must specify the full path /usr/bin/time. See the csh(1) reference page for a description of the built-in command.
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
time: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
Writes the timing output to standard error. This is the default.
OPERANDS
The name of a command to be executed. If command identifies any name specified as a special built in your applicable shell reference page,
the results are undefined and unpredictable. The argument to be passed to command. See the appropriate reference pages for these values.
This parameter may include flags and arguments expected by command.
DESCRIPTION
The time command prints the elapsed time during the execution of a command, the time spent in the system, and the time spent in execution
of the command on the diagnostic output system. Time is reported in seconds.
The time command (with a different format) is also built into csh.
NOTES
When time is used as part of a pipeline, the times reported are unspecified, except when it is the sole command within a grouping command
in that pipeline. For example, the commands on the left are unspecified; those on the right report on utilities a and c, respectively.
time a | b | c { time a } | b | c a | b | time c a | b | (time c)
EXIT STATUS
The time command returns the following exit values if the command could not be invoked: An error occurred in the time command. The command
specified by command was found but could not be invoked. The command specified by command could not be found.
If the command was successfully invoked, the exit status of time is the exit status of command.
EXAMPLES
To measure the time required to run a program, enter: time a.out
This runs the program a.out and writes to the standard error output the amount of real, system, and user time that it uses: real
10.5 user 0.3 sys 3.6 To measure the time required by a complex command, enter: time sh -c 'complex-cmmand-line'
This runs all of the commands, which may include pipelines, and returns the time information for the entire series of commands.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of time: Provides a default value for the internationalization variables that are
unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari-
ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value,
overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes
of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for-
mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of
LC_MESSAGES. Determines the path used to locate command.
SEE ALSO
Commands: csh(1), ksh(1), Bourne shell sh(1b), POSIX shell sh(1p)
Functions: times(3)
Standards: standards(5)
time(1)