![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with unix command | niks | UNIX for Dummies Questions & Answers | 3 | 02-09-2009 02:45 PM |
| assign a command line argument and a unix command to awk variables | sweta_doshi | Shell Programming and Scripting | 0 | 08-08-2008 06:54 AM |
| How to use more than one MPE command STREAM with Unix command in a single shell? | bosskr | HP-UX | 1 | 10-16-2006 04:16 PM |
| How to use more than one MPE command STREAM with Unix command in a single shell? | bosskr | Shell Programming and Scripting | 0 | 09-19-2006 09:44 PM |
| wc command help.... and other unix command....... urgent | dashi2k | UNIX for Dummies Questions & Answers | 1 | 01-20-2005 06:39 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
HP Unix Tee command.
work.txt
Code:
M|324324|32424|3431 N|324324|32426|3432 N|324324|32424|3434 M|324324|32424|3435 Code:
cat work.txt | tee >( grep '^M' > m.txt ) >( grep '^N' > n.txt ) Error: Code:
cat work.txt | tee >( grep '^M' > m.txt ) >( grep '^N' > n.txt )
ksh: syntax error: `(' unexpected
Last edited by vgersh99; 09-21-2009 at 09:56 AM.. Reason: code tags, PLEASE! |
|
||||
|
Thanks Jim. My code is below which does not work:
Code:
mkfifo $StdMarPbPipe1 && mkfifo $StdMarPbPipe2 ce_bcp.ksh -i out -d itg_credit -t samtmpv1 -f $StdMarPbPipe1 -F "|" -H "|" & tee $StdMarPbPipe2 < ( $StdMarPbPipe1 | grep "^N" | cut -d '|' -f 2-4 | sort -u > TestMarPbN.txt) & grep "^M" $StdMarPbPipe1 | cut -d '|' -f 2-4 | sort -u > TestMarPbM.txt Objective is: step1: Internal Bcp to -> pipe $StdMarPbPipe1 Then reading pipe1--> grep '^N' | cut | sort > TestMarPbN.txt Then reading pipe2--> grep '^M' | cut | sort > TestMarPbM.txt Like to use Tee command to avoid reading twice from pipe1. Last edited by vgersh99; 09-21-2009 at 09:57 AM.. Reason: code tags, PLEASE! |
|
||||
|
Tee command using pipe
work text.txt:
M|324324|32424|3431 N|324324|32426|3432 N|324324|32424|3434 M|324324|32424|3435 mkfifo $pipe1 $pipe2 tee $Pipe2 < ( $pipe1 | grep "^N" | cut -d '|' -f 2-4 | sort -u > TestMarPbN.txt) & grep "^M" Pipe1 | cut -d '|' -f 2-4 | sort -u > TestMarPbM.txt Here reading twice from pipe1 -- instead of that can we read only once using tee command. |
|
|||||
|
Quote:
Code:
an12:/home/vbe $ cat work.txt
M|324324|32424|3431
N|324324|32426|3432
N|324324|32424|3434
M|324324|32424|3435
an12:/home/vbe $ cat work.txt | tee >( grep '^M' > m.txt ) >( grep '^N' > n.txt )
ksh: 0403-057 Syntax error: `(' is not expected.
an12:/home/vbe $ oslevel
6.1.0.0
|
|
||||
|
Quote:
My hp-ux version (11.11) does not support this. I'm not sure if the newer versions are supposed to support it or not. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|