home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux      Getting to be as bloated as Windows!      107,822 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 106,219 of 107,822   
   Kenny McCormack to suzyw0ng@outlook.com   
   Re: >>&! in bash script?   
   07 Jun 24 17:37:32   
   
   From: gazelle@shell.xmission.com   
      
   In article ,   
   Woozy Song   wrote:   
   >Kenny McCormack wrote:   
   >> In article ,   
   >> Woozy Song   wrote:   
   >>> I was debugging some 20-YO shit and it has this:   
   >>> command inputfile >>&! tempfile   
   >>>   
   >>> It breaks down with dash shell (Debian/Ubuntu).   
   >>> It was supposed written for bash, but &! is a zsh thing.   
   >>   
   >> It is not clear what your question (i.e., reason for posting) is here.   
   >>   
   >> Are you looking for specific help with a specific shell programming   
   >> construct or are you just ranting (i.e., blowing off steam)?  There's   
   >> nothing wrong with the later if that is in fact the case.  But it will   
   >> clarify things if we know what the intent actually is.   
   >>   
   >   
   >I was curious if were some secret men's business that few people know,   
   >or was it a typo.   
      
   If you are actually looking for an explanation as to what it means, then   
   "man bash" has the answers.  Much better than asking on Usenet.   
      
   FWIW, after reading "man bash" and searching for "noclobber", I think what   
   we have is:   
       1) First, >& means merge stdout and stderr.  It is exactly equivalent   
   	to: >... 2>&1   
   	and should be avoided.  The normal version, with 2>&1 is much   
   	easier to understand, much more "portable" and not ugly.  I think   
   	the idea of providing a special operator for the merging of stdout   
   	and stderr originated with csh and got copied into bash (because in   
   	the early days, bash wanted, for marketing reasons, to be able to   
   	say they were (somewhat) csh-compatible).  It was a bad idea then   
   	and a bad idea now.   
       2) Putting another > in front makes it append to the file (if it   
   	already exists), rather then truncate it first.   
       3) The ! means create the file even if it exists and even if the   
   	"noclobber" option is set.  Seems like it would be easier to just   
   	unset "noclobber".   
      
   Does that answer your questions?   
      
   --   
   The randomly chosen signature file that would have appeared here is more than 4   
   lines long.  As such, it violates one or more Usenet RFCs.  In order to remain   
   in compliance with said RFCs, the actual sig can be found at the following URL:   
   	http://user.xmission.com/~gazelle/Sigs/GodDelusion   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca