Re: How to list the first 10 lines error from executing command
From: Ralf Fassel (ralfixx_at_gmx.de)
Date: 07/30/03
- Next message: Ralf Fassel: "Re: newbie: memory fault(core dump)"
- Previous message: Dermot Paikkos: "newbie: memory fault(core dump)"
- In reply to: JohnWu: "Re: How to list the first 10 lines error from executing command"
- Next in thread: JohnWu: "Re: How to list the first 10 lines error from executing command"
- Reply: JohnWu: "Re: How to list the first 10 lines error from executing command"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Jul 2003 14:19:45 +0200
* "JohnWu" <johnwu@yorku.ca>
| > javac file.java 2>&1 >/dev/null | head -10
| >
| > Joe
|
| Thanks, Joe
|
| In sh, it works, but I'm using tcsh and csh, it said that it was
| ambiguous redirect output, do you mind telling me again how to do it
| for tcsh, or csh?
You can't redirect stderr separate from stdout in csh, only both, like
this:
javac file.java |& head -10
javac file.java |& more
(man csh:
A simple command, or a set of simple commands separated by |
or |& characters, forms a pipeline. With |, the standard output
of the preceding command is redirected to the standard input of
the command that follows. With |&, both the standard error and
the standard output are redirected through the pipeline.
)
So if there is stdout-output as well, you might have to wrap Joe's
suggestion inside a call to sh -c, or just invoke sh for that single
command.
R'
- Next message: Ralf Fassel: "Re: newbie: memory fault(core dump)"
- Previous message: Dermot Paikkos: "newbie: memory fault(core dump)"
- In reply to: JohnWu: "Re: How to list the first 10 lines error from executing command"
- Next in thread: JohnWu: "Re: How to list the first 10 lines error from executing command"
- Reply: JohnWu: "Re: How to list the first 10 lines error from executing command"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|