bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with tee command


From: Bob Proulx
Subject: Re: Problems with tee command
Date: Thu, 22 Sep 2005 09:22:08 -0600
User-agent: Mutt/1.5.9i

Prashant Jha wrote:
> I am an IT Professional working on Unix (Solaris 5.8).
>  I would like to report the following error and request some information
> regarding the same.
>  There is a script with a line similar to -
>  echo `The World is not Enough` | tee -a Logs.txt

Hopefully that is similar and not exact.  You are using `...` here
which are backticks instead of '...' single quotes.  Using backticks
executes commands in the string.  You want the string quoted instead.
Hopefully this is a typo.

  echo 'The World is not Enough' | tee -a Logs.txt

>  While this script works fine generally...In some cases the script just
> hangs a 'ps -ef' shows the
> tee command to be executing for hours.
>  What does this mean and why does this occur?
>  Any information would be a great help.

This should never hang.  Therefore it must be an outside influence.
Is the Logs.txt file on a network attached filesystem?  I will guess
that it is and that the delay comes from there.  Try repeating the
behavior on a local filesystem.

The 'tee' program reads input and writes the data both to the standard
output passing it along and also to any listed files.  It does this by
calling the system write(2) kernel routine.  This is an I/O process
external to the tee program.

If the tee program is getting blocked on I/O in the kernel and showing
up in the ps listing then I can only guess that this is writing to a
network device and the networked device is "blocking".  I guess this
because a local disk device should never block.  I would investigate
this aspect of the problem.

Other than this I am not sure what to suggest.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]