redirection with pipe don't work

Nov 28, 2012
4
0
I use tc 14.03.51 x64 on OS Windows 7 64bit and if i try to redirect via pipe the result are always zero.

dir d:\ | findstr zip in a tcc shell the resut ist empty

[C:\Program Files\JPSoft\TCMD14x64]dir d:\ | findstr zip
[C:\Program Files\JPSoft\TCMD14x64]

in a cmd shell

C:\Program Files\JPSoft\TCMD14x64>dir d:\ | findstr zip
13.11.2012 10:43 546.365 deploy-tftp.zip
C:\Program Files\JPSoft\TCMD14x64>
Any ideas?

Cheers
Wolfgang
 
Nov 28, 2012
4
0
the findstr is not the issue, if I use grep the result is the same. so I wil try to deinstall and install TC. I know that it works in all older versions, but I have no feeling at what time it begans to fail:-(.
 
Nov 28, 2012
4
0
First the reinstalling was not really successfullyL

The output for *dir | list looks fine for me. Sorry the beginning, it’s GermanJ

STDIN F1 Hilfe Spalte 0 Zeile 1 0%
Datenträger in Laufwerk C ist unbezeichnet Seriennummer ist 7aac:4ecd
Verzeichnis von C:\Program Files\JPSoft\TCMD14x64\*

28.11.2012 14:58 <DIR> .
28.11.2012 14:58 <DIR> ..
14.11.2012 11:37 5.310 alias.lst
22.02.2006 21:40 34.304 BorlndMM.dll
26.11.2012 18:05 621.208 English.dll
…………

If I use ls.exe or fi.exe everything works fine.

If I use only one digit I get a result like this. If I copy this to notepad, there is a space between all characters.

[C:\Program Files\JPSoft\TCMD14x64]dir | findstr t
D a t e n t r õ g e r i n L a u f w e r k C i s t u n b e z e i c h n e t S e r i e n n u m m e r i s t 7 a a c : 4 e c d
V e r z e i c h n i s v o n C : \ P r o g r a m F i l e s \ J P S o f t \ T C M D 1 4 x 6 4 \ *
1 4 . 1 1 . 2 0 1 2 1 1 : 3 7 5 . 3 1 0 a l i a s . l s t
2 6 . 1 1 . 2 0 1 2 1 8 : 0 5 6 4 7 . 8 3 2 I t a l i a n . d l l
2 6 . 1 1 . 2 0 1 2 1 8 : 0 5 4 1 0 . 2 6 4 I t a l i a n D . d l l
2 9 . 0 6 . 2 0 1 2 2 1 : 5 2 9 . 4 6 9 l i c e n s e . t x t
2 9 . 0 6 . 2 0 1 2 2 1 : 5 2 7 . 1 3 1 r e a d m e . t x t
2 4 . 0 1 . 2 0 0 0 1 1 : 0 1 4 5 3 . 6 3 2 s t d v c l 4 0 . d l l
2 6 . 1 1 . 2 0 1 2 1 8 : 0 4 1 . 5 2 2 . 1 7 6 t a k e c m d . d l l
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,463
88
Albuquerque, NM
prospero.unm.edu
If I use only one digit I get a result like this. If I copy this to notepad, there is a space between all characters.

[C:\Program Files\JPSoft\TCMD14x64]dir | findstr t
D a t e n t r õ g e r i n L a u f w e r k C i s t u n b e z e i c h n e t S e r i e n n u m m e r i s t 7 a a c : 4 e c d
V e r z e i c h n i s v o n C : \ P r o g r a m F i l e s \ J P S o f t \ T C M D 1 4 x 6 4 \ *
1 4 . 1 1 . 2 0 1 2 1 1 : 3 7 5 . 3 1 0 a l i a s . l s t
2 6 . 1 1 . 2 0 1 2 1 8 : 0 5 6 4 7 . 8 3 2 I t a l i a n . d l l
2 6 . 1 1 . 2 0 1 2 1 8 : 0 5 4 1 0 . 2 6 4 I t a l i a n D . d l l
2 9 . 0 6 . 2 0 1 2 2 1 : 5 2 9 . 4 6 9 l i c e n s e . t x t
2 9 . 0 6 . 2 0 1 2 2 1 : 5 2 7 . 1 3 1 r e a d m e . t x t
2 4 . 0 1 . 2 0 0 0 1 1 : 0 1 4 5 3 . 6 3 2 s t d v c l 4 0 . d l l
2 6 . 1 1 . 2 0 1 2 1 8 : 0 4 1 . 5 2 2 . 1 7 6 t a k e c m d . d l l

Aha -- you have UnicodeOutput turned on, and your utilities aren't expecting to see UTF-16. Try OPTION //UNICODEOUTPUT=NO and see if that doesn't make them happy.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,463
88
Albuquerque, NM
prospero.unm.edu
If you type OPTION and select the first tab ("Startup"), you'll find an item called "Unicode Output" in the right-hand column. That sets the default value for that option; you probably want to turn it off. (On the rare occasion when you do want to write Unicode, you can turn it on temporarily with OPTION //UNICODEOUTPUT=YES, and then turn it off afterwards with OPTION //UNICODEOUTPUT=NO.)
 
May 20, 2009
293
5
57
ITALY
In my case I have the option set to Yes.

If I type
Code:
assoc | find /I "bat"
I get no result.

But, if I type
Code:
assoc |! find /I "bat"
I get the correct lines.

In my case, "which find" says "find is an external : F:\WINDOWS\system32\find.exe".
So, maybe the in-process piping is using only ansi? Is this correct or is it a bug?

Thank You and regards

Rodolfo Giovanninetti
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,463
88
Albuquerque, NM
prospero.unm.edu
So, maybe the in-process piping is using only ansi? Is this correct or is it a bug?

It looks like the in-process pipe is also generating UTF-16, but in-process pipes get a BOM and real pipes don't. I don't know whether that's an actual bug, or whether Rex has some deep reason for doing it that way!
 

rconn

Administrator
Staff member
May 14, 2008
12,346
150
It looks like the in-process pipe is also generating UTF-16, but in-process pipes get a BOM and real pipes don't. I don't know whether that's an actual bug, or whether Rex has some deep reason for doing it that way!

WAD. As with 99% of the things that don't make a lot of sense, it's for compatibility with CMD.EXE (which doesn't add a BOM for unicode output).

In-process pipes are different for two reasons: (1) they're actually redirected files (>output & <input), so they need a BOM so the file handling code can interpret them, and (2) CMD doesn't support them, so compatibility is irrelevant.
 
Similar threads
Thread starter Title Forum Replies Date
vefatica Redirection and memory leak? Support 3
A WAD Output redirection to IF block fails with "unbalanced brackets" Support 7
N multiple command alias and redirection Support 0
nikbackm Switch Case and here-document redirection Support 2
M Piping and redirection: CON: Support 5
J WAD Output redirection in tcexit looses data Support 31
J Vers. 18 Here doc redirection broken? Support 4
vefatica Redirection vs. piping? Support 4
I "IF" command in a variable does not expand redirection variable name Support 0
P Fixed TCC 17 describe redirection Support 3
vefatica Speeding up redirection to NUL? Support 32
fpefpe WOW64 Redirection Support 8
D Redirection to clip - env dependency? Support 3
A Dual redirection Support 3
krischik I/O redirection with start command. Support 6
L redirection to/by perl acts bizarrely Support 9
Charles Dye Strange output, here-doc redirection, TYPE, //UnicodeOutput=Yes Support 6
Daniel Wee Rexx output redirection seems to be broken Support 4
H "Here-String" redirection not working Support 6
Peter Murschall PIPE Fittings makes Errors Support 3
vefatica DO ... pipe ... simplified Support 11
vefatica DO ... | ... (pipe ends prematurely) Support 18
Joe Caverly Pipe into VIEW and search Support 12
nikbackm Pipe performance in TCC v20 Support 3
vefatica IFTP problems (broken pipe?) Support 24
G WAD Pipe clears screen Support 2
S @CON: does not work with sendmail for pipe Support 2
A Escape characters on right side of pipe Support 0
nikbackm Output of non-ascii characters via pipe Support 1
N Can't set an env variable via pipe Support 8
R Bug TPIPE's pdf to text conversions don't work Support 2
vefatica Console popup windows don't work correctly Support 0
M Backquoted parameters used in GoSub don't pass string as a single parameter Support 2
V Ctrl-Home/End don't work in Win10 Support 3
vefatica Documentation Help: links to "Conditional expressions" don't work Support 2
RChrismon How to? Changes to Options Don't Save Support 8
vefatica Unicode ... I don't understand Support 1
MickeyF WAD 'if' and aliases don't mix so well Support 5
D How to? V15.00.30 -(help!) - Floating view windows don't open Support 1
vefatica Backquotes, aliases get 'em, BTMs don't? Support 1
D Automatic directory changes don't work at all Support 4
vefatica @PID, ISAPP - don't see system processes Support 12
J Fixed IDE search keys don't work in TCMD 13.01.32 Support 3
M An issue I really don't understand and is too long and detailed for this "Title" line... Support 16
vefatica =~ ... still don't get it Support 4
vefatica "Administrator:" - I don't want to see it Support 0
C NTFS Descriptions don't work? Support 3
B What Don't I Understand About @SERVICE Support 9
R Don't wake up external drives on startup Support 2

Similar threads