[CLUE-Tech] bash: overwrite and redirect

Michael J. Hammel mjhammel at graphics-muse.org
Mon Feb 17 21:42:50 MST 2003


On Mon, 2003-02-17 at 21:30, Jason S. Friedman wrote:
> If I try to do both:
> some command &>| result_file
> 
> I get this error:
> -bash: syntax error near unexpected token `|'
> 
> What's a straightforward way to both redirect and force a clobber?

some command 2>&1 > result_file

Redirects stderr to stdout, then redirects stdout to result_file,
overwriting the existing contents of that file.

-- 
Michael J. Hammel                               The Graphics Muse 
mjhammel at graphics-muse.org                      http://www.graphics-muse.com
------------------------------------------------------------------------------
You will never find anybody who can give you a clear and compelling
reason why we observe daylight savings time. -- Unknown.



More information about the clue-tech mailing list