On  6 Sep, David Fitch wrote:
>  > I am trying to redirect and append stdout and stderr to a file. 
>  > I gave &>> a try put that doesn't work. HELP! 

That looks like >>& which I think is a csh style re-direction.  Can't
help you there, sorry.  Maybe you can't?  Referring to "Csh Programming
Considered Harmful", e.g. from
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

    1a. Writing Files
    
    In the Bourne shell, you can open or dup arbitrary file descriptors.
    For example,
    
        exec 2>errs.out
    
    means that from then on, stderr goes into errs file.
    
    Or what if you just want to throw away stderr and leave stdout
    alone?    Pretty simple operation, eh?
        
        cmd 2>/dev/null
    
    Works in the Bourne shell.  In the csh, you can only make a pitiful
    attempt like this:
        
        (cmd > /dev/tty) >& /dev/null
    
    But who said that stdout was my tty?  So it's wrong.  This simple
    operation *CANNOT BE DONE* in the csh.
    

>  the "usual" way is: 
>  echo "fred" >> /tmp/log 2>&1 

Yep.  The >> always means append instead of truncate the file; the 2>&1
means to duplicate file descriptor 2 (stderr) onto f.d. 1 (stdout). 
You have to do that *after* directing stdout to the right place (in the
above example, /tmp/log).

>  (there's plenty of other variations though) 

I can't think of any other ways, myself!
 
luke

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to