[CLUE-Tech] bash: overwrite and redirect

Jason S. Friedman jason at powerpull.net
Mon Feb 17 20:30:24 MST 2003


I know that I can redirect stdout and stderr with the &>:

some command &> result_file
#sends stdout and stderr to result_file

I know that I can overcome the noclobber setting with the |:

some command >| result_file
# sends stdout to result_file, clobbering result if it exists

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?



More information about the clue-tech mailing list