On Fri May 18 2007 12:39, M Harris wrote:
>
> Try this:
>
> which time
>
> You will probably notice that it just returns to the prompt... and
> does not tell you which time... because it is finding the one built
> into the shell.
>
> which /usr/bin/time
>
> Now you will notice that it finds the system time command--- and the
> two are different.
>
> compare:
>
> #>time
>
> #>/usr/bin/time
>
> The outputs will be different. Use the /usr/bin/time and you'll get
> what you want.
Now, here is a puzzle:
[EMAIL PROTECTED]:~> which time
/usr/bin/time
[EMAIL PROTECTED]:~> type time
time is a shell keyword
[EMAIL PROTECTED]:~> time --help
bash: --help: command not found
real 0m0.011s
user 0m0.000s
sys 0m0.004s
That is, in my case the built-in "time" has precedence, but "which" is
giving the impression that I would be running /usr/bin/time.
If I use the option -a:
[EMAIL PROTECTED]:~> which -a time
/usr/bin/time
[EMAIL PROTECTED]:~> type -a time
time is a shell keyword
time is /usr/bin/time
Since "which" gives out nothing in the case of a shell built-in command,
perhaps what it is doing everytime is 1) giving out nothing, 2) giving
out /usr/bin/time in second place.
So, "type" seems to be more useful here.
Carlos FL
--
Who is General Failure, and why is he reading my disk?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]