I am using the time command in a script however the output of the time command will display on my screen but not my output file. Any Ideas on how to fix this?
> cat test.sh
#############################
#!/usr/bin/sh
for COMMAND in pwd
do
time ${COMMAND}
done | sed "s/^/ ... (4 Replies)
I am using ksh on an AIX box.
I would like to redirect the stdout and stderr to a file but also show them on the terminal. Is this possible? I have tried tee within my file without success.
This is the code I have so far
exec > imp.log 2>&1 | tee exec 1>&1
I am new to shell scripting, so... (3 Replies)
exam is a ksh script. In command line I enter: exam 3 param_2 param_3 param_4.
In exam how can I get the value of the parameter which position is specified by the first argument.
Simply doing this DOES NOT work:
offset=$1
value=$$offset
can you figure out any possible way to interpret a... (5 Replies)
Hello all,
I have a script that I am trying to execute and redirect the output to a file, but I have trouble in redirection. The cron job is running properly as I see it in the mail.
This is what I am doing
In crontab file,
0 4 * * * somescript.sh > /some_location/`date '+%m%d%y_%H%M'`.log... (9 Replies)
Hi,
I need to create one KSH which will send mail to set of recipients using "mailx" command like below.
mailx -s "Test mail" "test@yahoo.com, test@gmail.com" <$output.txt
The recipients are in different domains (like yahoo, gmail, etc.).
My requirement is, if any mail is undelivered,... (1 Reply)
Hi,
I have perl script which is calling an external command using "system()" with argument.
But i am not able to capture the output.Even tried with backtick also with no luck.
.
.
$number=<>;
system ("cmd $number >output.txt"); (2 Replies)
Hello,
i'm trying to implement the times() function and i'm programming in C.
I'm using the "struct tms" structure which consists of the fields:
The tms_utime structure member is the CPU time charged for the execution of user instructions of the calling process.
The tms_stime structure... (1 Reply)
I have a script to send an email like below. Problem is, the if ..fi block is not getting executed, and is coming as a part of the email body. Can anyone take a look at this? :confused:
Log file shows this:
SEND_MAIL.prog: line 64:
: command not found
echo "Input Parameters"
echo... (11 Replies)
Hello all,
I would like to create a for loop or whatever is quick that will print the one’s place of a number for 1-N times
say for example a printed page formatting is 132 characters wide,
I would like a single line
123456789012345678901234567890... ...012
That is 132 characters long. I... (11 Replies)
Hi
Please can you help how do I count the number of specific characters or words that appear in a file? (8 Replies)
Discussion started by: fretagi
8 Replies
LEARN ABOUT PHP
times
times(1) User Commands times(1)NAME
times - shell built-in function to report time usages of the current shell
SYNOPSIS
sh
times
ksh
times
DESCRIPTION
sh
Print the accumulated user and system times for processes run from the shell.
ksh
Print the accumulated user and system times for the shell and for processes run from the shell.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not
performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO ksh(1), sh(1), time(1), attributes(5)SunOS 5.10 15 Apr 1994 times(1)