What does this mean?

Hello all,
I am a newbie in shell scripting.
I want to know what does the below text means?

6.355u 1.679s 0:12.68 63.2% 0+0k 0+0io 0pf+0w

I am getting this line (on terminal) after every successful execution of my script.

Thanks in advance . . :slight_smile:

-MD

Hi

Thats what your script does, you're supposed to know what YOUR script does....
Whats the content of it?

Cheers

Well it can be anything . .
I have written three scripts by now and after successful execution of each script, there's a message as shown before.
Only the field values are changing . .

Like,

5.85u 4.679s 0:16.78 105.2% 1+6k 7+8io 5pf+7w

I want to know the significance of each field . .

Thanks for reply :slight_smile:

-MD

Share your scripts, so we know what it does, so we can tell you which values are from where and identify it.

Give us information to work with.
Without know/see what your script does - its like mind reading.
Obviously that doesnt work.

Could you show us the output from the following commands pasted into CODE tags to make them easier to read please?

  • trap
  • alias
  • /bin/echo "Hello"
  • or wherever echo is. I want it to start a process though rather than using a built-in.

I'm guessing that someone has set a trap for DEBUG that does some accounting, but I may be wrong.

Does that show anything up?

Robin
Liverpool/Blackburn
UK

I'm guessing -- only guessing, mind you -- that something in your scripts is using the shell's time builtin. This can change a lot across different systems but I recognize some parts of it:

It's telling you how much time something spent running as User(5.85 seconds), as System (4.679 seconds), and a total of 16.78 seconds (so must have spent some seconds just sitting waiting for I/O).

Try time sleep 10 in your shell.

The rest I'm not sure of. I'm not even sure what the "something" was since you refuse to post your script. What's your system? uname -a if you don't know.

1 Like

Thanks for your replies guys :slight_smile:

Below is a simple perl code . . Check it out . .

 
#! usr/bin/perl
use POSIX;
use strict;
use warnings;
my $file = $ARGV[0];
open FILE,'<', $file;
while (my $line = <FILE>){print $line;}
my $var = 5;
print $var;

it gave me

 
0.355u 1.00s 0:1.01 110.2% 0+0k 0+0io 0pf+0w

on the terminal, after printing the contents of the file that I've given as ARGV[0] . .
And yes, that file does not contain the above line . .

uname -a gives,

 
Linux <username> 2.6.18-274.3.1.el5 #1 SMP <date & time> x86_64 GNU/Linux

I am using Redhat 5.0 . .

Also, time sleep 10 gives,

 
0.000u 0.000s 0:10.00 0.0% 0+0k 0+0io 0pf+0w

so I guess you're on right track, Corona688

So, What does the rest four fields signify?

Thanks,
-MD

Check if the TIME environment variable is set, and to which value. Then check TIME 's elements against man time .

I see nothing in that Perl script which would cause that line to be printed. I suspect your script is calling it in a manner similar to time ./scriptname or time perl ./scriptname

I don't recognize most of the rest of that string, the TIME variable might be revealing.

Is that a widely-adopted variable? I've never heard of it. I would be grateful for any pointer to TIME documentation.

Regards,
Alister

---------- Post updated at 08:49 PM ---------- Previous update was at 08:30 PM ----------

From a tcsh man page:

       time    If set to a number, then the time builtin (q.v.) executes auto-
	       matically after each command which takes more  than  that  many
	       CPU seconds.  If there is a second word, it is used as a format
	       string for the output of the time builtin.  (u)	The  following
	       sequences may be used in the format string:

	       %U  The time the process spent in user mode in cpu seconds.
	       %S  The time the process spent in kernel mode in cpu seconds.
	       %E  The elapsed (wall clock) time in seconds.
	       %P  The CPU percentage computed as (%U + %S) / %E.
	       %W  Number of times the process was swapped.
	       %X  The average amount in (shared) text space used in Kbytes.
	       %D  The	average  amount in (unshared) data/stack space used in
		   Kbytes.
	       %K  The total space used (%X + %D) in Kbytes.
	       %M  The maximum memory the process had in use at  any  time  in
		   Kbytes.
	       %F  The	number of major page faults (page needed to be brought
		   from disk).
	       %R  The number of minor page faults.
	       %I  The number of input operations.
	       %O  The number of output operations.
	       %r  The number of socket messages received.
	       %s  The number of socket messages sent.
	       %k  The number of signals received.
	       %w  The number of voluntary context switches (waits).
	       %c  The number of involuntary context switches.

	       Only the first four sequences are supported on systems  without
	       BSD  resource limit functions.  The default time format is `%Uu
	       %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww'  for systems  that  support
	       resource  usage	reporting and `%Uu %Ss %E %P' for systems that
	       do not.

The default format matches the OP's output exactly:

Regards,
Alister

2 Likes

Thank you every1 for your replies.
It was a really good discussion session for me :slight_smile:
Your ans is perfect alister, thnaks.

Cheers !!
-MD

1 Like

Thanks for confirming that you have a solution.

Robin

...and if you'd posted your code the first time we asked, it wouldn't have taken us 2 days to learn that you use the C Shell.

1 Like

How do you came to know that I use C shell?

And what's the difference between CSH, SH, KSH and all other such variants?

Thank you,
-MD

From the way your time command works. That's how the csh one works.

sh, bash, and ksh are all fundamentally the same language( sh is basic Bourne shell, BASH and KSH are extensions). csh and tcsh are rather their own thing, and definitely not recommended due to a variety of bugs and unreconcilable design flaws.

1 Like

Thank you again Corona688.

  • MD