Re: I/O redirection problem
From: Chris F.A. Johnson (c.fa.johnson_at_rogers.com)
Date: 05/26/04
- Next message: Stephane CHAZELAS: "Re: I/O redirection problem"
- Previous message: Krit Kasemosoth: "I/O redirection problem"
- In reply to: Krit Kasemosoth: "I/O redirection problem"
- Next in thread: Stephane CHAZELAS: "Re: I/O redirection problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 May 2004 11:47:22 GMT
On 2004-05-26, Krit Kasemosoth wrote:
> I have data file 'test.txt'. I want to search text in that file and
> store
> the result back to file 'test.txt'. The command that I execute is :
>
> cat test.txt | grep monday > test.txt
>
> I execute it on two machines that have same environment(same OS,
> shell and utilities version).
> The command work on one machine (result of execution store in
> 'test.txt') but not work on another machine ('test.txt' is empty).
>
> What are the possible factors that make the command work ?
> (Because the command redirect output back to original file
> which must can not work)
I wouldn't count on it working every time (did you try it more
than once?).
Presumably it worked because the (normally unnecessary) cat had
finished before the redirection was executed (perhaps because the
file was still in the cache?).
> This is a information of my two machines :
>
> 1. SunOS dev_24 5.8 Generic_108528-21 sun4u sparc SUNW,UltraAX-i2
> 2. SunOS ceres 5.8 Generic_117000-01 sun4u sparc SUNW,Ultra-Enterprise
--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
===================================================================
My code (if any) in this post is copyright 2004, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
- Next message: Stephane CHAZELAS: "Re: I/O redirection problem"
- Previous message: Krit Kasemosoth: "I/O redirection problem"
- In reply to: Krit Kasemosoth: "I/O redirection problem"
- Next in thread: Stephane CHAZELAS: "Re: I/O redirection problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|