Re: Bash script piping question



On Sun, 18 Dec 2005 20:31:46 -0500, Dan Ganek wrote this:

> noi wrote:
>>
>> I'd like to pass output from a command to stdout and a pipe.
>>
>> Like in $ cat test.file | if grep word ; then do; but I'd like to see
>> all of the output from the cat command as well as pass that output to
>> the grep test.
>>
>> Anyone know how to do that?
>>
>> TIA
>
> man tee


Nope doesn't work. An output file is needed for the tee command to work.
So I'd have to cat the output file instead of seeing the stdout.


.



Relevant Pages

  • Re: Script help: convert music files to be compatible with MPD
    ... command will be written to it. ... I tried it with both> and>> and with the file both left and right of the escaped semicolon. ... It looks as if find redirects its own output file or pipe and then runs external commands with its outputs spliced onto its own output channels. ... cat /dev/null> $@ ...
    (uk.comp.os.linux)
  • Re: MCP compressor, or C porting
    ... I believe that the UNIX CAT command does a number of different things ... it transfers data from one or more input ... to an output file. ...
    (comp.sys.unisys)
  • Re: Problem with WSH Shell Exec StdOut
    ... catch its StdOut stream in real time. ... NeroCmd.exe is a command line utility included ... Here is the script I'm currently using: ...
    (microsoft.public.scripting.vbscript)
  • Re: Problem with WSH Shell Exec StdOut
    ... catch its StdOut stream in real time. ... then almost immediately I get a command window displaying the following: ... You have to abort the script by ending the ...
    (microsoft.public.scripting.vbscript)
  • Re: Can you duplicate Standard Output WITHOUT tee command?
    ... run where he wanted to catch stdout. ... Yes, this is a difficult command pipe, especially as written it uses ... The last file descriptor operations restore the normal meaning of stdin ...
    (comp.unix.shell)