Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jan 2001 22:18:01 +0100
From:      Cliff Sarginson <cliff@raggedclown.net>
To:        "Justin W. Pauler" <jwpauler@jwpages.com>
Cc:        freebsd-questions@FreeBSD.ORG, freebsd-stable@FreeBSD.ORG
Subject:   Re: tail
Message-ID:  <20010128221801.A2923@raggedclown.net>
In-Reply-To: <01012813255100.83352@gateway.drnet.fais.net>; from jwpauler@jwpages.com on Sun, Jan 28, 2001 at 01:25:51PM -0600
References:  <01012813255100.83352@gateway.drnet.fais.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 28, 2001 at 01:25:51PM -0600, Justin W. Pauler wrote:
> I am not sure if this is a command, but if not, I think it would be useful. I 
> have often needed to watch output from different commands like df, but I have 
> to continously run the command to get the latest amount. I was thinking, why 
> couldn't tail do that? Since it can watch files for changes and display 
> those, why not for a command?
> 
> I tried tail -f |df -h and could not get it to update. I would appreciate 
> your thoughts.
> 
> I am also cc'ing this to stable in cause it is a bug/feature...

Mmm.. methinks you are confused !
The command as you tyoed it will have tail read it;s standard input,
the terminal, and pipe it's output into df. Since df is not a filter
it will ignore it. If it would work then you would need to change
it around to "df | tail -f".
However df will only execute once, so that won;t do what you want.
To repeatedly execute a command put it in a loop:

while :
do df
done

If you want it to wait a while put a sleep in it, to space it
out put an echo..e.g.

while :
do df
sleep 2
echo
done

However, on Linux there is a program called "watch" that repeatedly
executes a command an displays it on the screen updating the
display "in place" .. so it does not scroll away. I am sure there
must be a similar program on BSD (I would like to know as well!)
but the program named "watch" on FBSD is something
different.

Cliff




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010128221801.A2923>