How to redirect standard error to standard output (in csh)?

How to redirect standard error to standard output (in csh)?

Post by Alex Vinoku » Wed, 11 Nov 1998 04:00:00



[ uuu < 1K ]

Hi,

In sh  we can redirect standard error to standard output :
        command_line 2>&1

How to do it in csh?

        Thanks in advance,
        Alex

 
 
 

How to redirect standard error to standard output (in csh)?

Post by Thomas Kling » Wed, 11 Nov 1998 04:00:00


On Tue, 10 Nov 1998 07:43:57 GMT, Alex Vinokur


>Hi,

>In sh  we can redirect standard error to standard output :
>    command_line 2>&1

Try following:
csh -c 'command_or_script' >> /your/path/file 2>&1

Done several times with cronjobs, always worked.

Kind regards

       Thomas Klinger
       Systemspecialist
=======================================

http://www.mobilkom.at
=======================================

 
 
 

How to redirect standard error to standard output (in csh)?

Post by Birger Blix » Wed, 11 Nov 1998 04:00:00



> On Tue, 10 Nov 1998 07:43:57 GMT, Alex Vinokur

> >Hi,

> >In sh  we can redirect standard error to standard output :
> >       command_line 2>&1

> Try following:
> csh -c 'command_or_script' >> /your/path/file 2>&1

> Done several times with cronjobs, always worked.

> Kind regards

>        Thomas Klinger
>        Systemspecialist
> =======================================

> http://www.mobilkom.at
> =======================================

No , then you are using sh to redirect errors from csh.
Use   command >&  outfile  or command >>& outfile   , command |&
command  in csh.
/BB
--
Error #152 - Windows not found: (C)heer (P)arty (D)ance
 
 
 

How to redirect standard error to standard output (in csh)?

Post by Ivan Santhumayo » Wed, 11 Nov 1998 04:00:00


Try:

(command_line > outfile) >& errfile

Note: The paranthensis filters the stdout first and the rest which is
stderr goes to the errorfile.

Ivan

Note: These are my own views and not of Goldman Sachs


> Hi,

> In sh  we can redirect standard error to standard output :
>         command_line 2>&1

> How to do it in csh?

>         Thanks in advance,
>         Alex

 
 
 

How to redirect standard error to standard output (in csh)?

Post by Barry Margoli » Wed, 11 Nov 1998 04:00:00




Quote:>Try:

>(command_line > outfile) >& errfile

>Note: The paranthensis filters the stdout first and the rest which is
>stderr goes to the errorfile.

That's the answer to the more common question "How to redirect standard
error to someplace *different* from standard output?", but that's not what
he asked.

The simple answer is that C shell doesn't have anything precisely
equivalent to shell's 2>&1.  If you're redirecting stdout at the same time,
you can use >& to redirect them together.

If your system has /dev/fd, you can probably use: >&/dev/fd/1

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Don't bother cc'ing followups to me.

 
 
 

1. redirecting standard output and standard error

Hi,

I want to call a command using C programmatically using execv, but I
also want to capture the standard output and standard error to files I
specify through command line args.  I want to use the file descriptors
0, 1, and 2 appropriately for this, and I understand I should probably
call a fork()
when calling the execv so my program can return successfully.  But
from there,
I'm not sure where to start.  I think I want to probably use dup2 so I
can redirect the descriptors to files I open.  Maybe create a pipe
from the child process to the parent process, where I pass through the
pipe are the results of the command call ??  Just need some guidance
and want to make sure I'm in the right direction.  Thanks.

2. script to run telnet

3. differentiate between standard output and standard error?

4. login question

5. Redirect standard error in csh ??

6. UUC:P LOGIN PROBLEMS

7. Redirecting standard output and error to a file

8. gdm_slave_windows_kill_ioerror_handler

9. How to redirect (and append) standard output/error to a log file?

10. LCSDNYR 2001 -> standards, standards, standards

11. Redirecting standard output and error

12. How to redirect standard output and error messages in a make file

13. how to direct standard output and error output to the same file in tcsh