Re: Redirecting the output to input file
Date: Wed, 16 Feb 2005 12:46:05 +0100
Kasper Dupont <firstname.lastname@example.org> writes:
> email@example.com wrote:
>> In our environment, cat is not a built-in. It's the executable
>> /usr/bin/cat. So, still my doubt is not cleared.
> In that case I suggest you verify if the command "cat x > x"
> actually truncates the file. I guess it might truncate the
> file before calling cat, and by the time cat is called and
> print the error message the file has already been truncated.
The question is why cat even bothers to check.
- Re: what make this shell script unstable?
... One that runs cat that opens ... "abc" readonly, one that opens "abc" write-only with truncation ... Behavior may also depend on how your system truncates files. ...
- Re: So nobody has any comments on anything today?
... Scared my cat. ... BTW, any way to see the whole mouseover ... It truncates at "benz..." ...
- Re: cut byte
... Peter Cheung writes: ... This truncates the input to 10 characters and then produces the 4th byte ... cat hd.img| cut -b 4 ...
- Re: Redirecting the output to input file
... On 2005-02-16, Kasper Dupont wrote: ... > actually truncates the file. ... cat: x: input file is output file ... The shell opens/truncates the file, does a fork, dup's ...