You are not logged in.

#1 2011-02-26 22:15:40

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

[SOLVED] bash >| redirection

I was looking at rc.sysinit just now, and noticed use of the redirection operator ">|"

Google doesn't return much for me, I guess it doesn't like those characters.

What does >| do?

Last edited by fukawi2 (2011-02-27 08:23:57)

Offline

#2 2011-02-26 22:22:48

jakobm
Member
Registered: 2008-03-24
Posts: 132

Re: [SOLVED] bash >| redirection

From bash(1) manpage:

Redirecting Output                                                
   [...]
   The general format for redirecting output is:

      [n]>word

   If  the  redirection operator is >, and the noclobber option to
   the set builtin has been enabled, the redirection will fail  if
   the  file  whose name results from the expansion of word exists
   and is a regular file.  If the redirection operator is  >|,  or
   the  redirection  operator is > and the noclobber option to the
   set  builtin  command  is  not  enabled,  the  redirection   is
   attempted even if the file named by word exists.

Offline

#3 2011-02-26 22:22:53

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: [SOLVED] bash >| redirection

not sure about bash but i know in zsh it's just like > but truncates to zero first and forces clobbering even if a clobber option is unset.

Offline

#4 2011-02-27 08:23:39

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: [SOLVED] bash >| redirection

Ah, make sense then.. Thanks guys smile

Offline

Board footer

Powered by FluxBB