TPipe relaunches TCC window and 4start, etc

Dec 30, 2010
13
0
Fellow Jeniuses (intentional misspelling to show our humility),

I have decided to try to break my old sed / grep / awk habits and start learning and using TPIPE.

When sitting at the TCC prompt, if I just type:

tpipe /grep=3,0,0,0,0,1,0,0,"Tract Master Main - " /input=TM_ALL_List.tmp

it appears that TCC reloads (I see my various 4start text roll by) and then, the results

Here is a normal TCC window start screen for me (mainly 4start stuff):

=====================
. Logged in as MJohnson4... Welcome to Work, Mark!
. Checking folders...
. We are now in the U:\DosUtils\4NT\ folder...
. Alias's read from U:\DosUtils\4NT\Work_Alias.sav file...
. Functions read from U:\DosUtils\4NT\Work_Functions_V12.sav file (by 4start)...
. Script 4Start being validated...
. Script 4Start Validated...
. Ctrl-T set to run TCC. Ctrl-F4 will exit TCC...
. Logging turned off...
. History read from U:\DosUtils\4NT\Work_History.sav file...
[U:\DosUtils\4nt]
=====================


now, I type the tpipe command:
tpipe /grep=3,0,0,0,0,1,0,0,"Tract Master Main - " /input=TM_ALL_List.tmp

that screen clears, then this appears:
=====================
. Logged in as MJohnson4... Welcome to Work, Mark!
. Checking folders...
. We are now in the U:\DosUtils\4NT\ folder...
. Alias's read from U:\DosUtils\4NT\Work_Alias.sav file...
. Functions read from U:\DosUtils\4NT\Work_Functions_V12.sav file (by 4start)...
. Script 4Start being validated...
. Script 4Start Validated...
. Ctrl-T set to run TCC. Ctrl-F4 will exit TCC...
. Logging turned off...
. History read from U:\DosUtils\4NT\Work_History.sav file...

\\row.myacmp.com\Guides and Recources\MLP Mortgage\REPORTS\MJohnson Master Files\All Areas Management\Tract Master Main - 20131105 V4c_278.xl
sx

\\row.myacmp.com\Guides and Recources\MLP Mortgage\REPORTS\MJohnson Master Files\All Areas Management\Tract Master Main - 20131105 V4c_279.xl
sx
set CCYYMMDD=20131115
set HHMM=0957
set stamp=201311150957
echo stamp set to: 201311150957
stamp set to: 201311150957
pushd U:\DosUtils\4NT
history > Archived\Work_History_201311150957.txt
copy /q Archived\Work_History_201311150957.txt Work_History.sav
popd
echo History saved as Work_History.sav
History saved as Work_History.sav
set CCYYMMDD=20131115
set HHMM=0957
set stamp=201311150957
echo stamp set to: 201311150957
stamp set to: 201311150957
pushd U:\DosUtils\4NT
copy /q 4nt.log Archived\Work_4nt_201311150957.log
echo > 4nt.log
popd
echo 4nt.log saved as Work_4nt_201311150957.log
4nt.log saved as Work_4nt_201311150957.log
[U:\DosUtils\4nt]
=====================


I see the TPIPE results (in bold) intermixed with a bunch of 'echoed on' 4start and startup alias commands.

If instead I use grep (GNU):
grep -i "Tract Master Main - " TM_ALL_List.tmp
the output is just 2 new lines at the current screen location:
=====================
[U:\DosUtils\4nt]grep -i "Tract Master Main - " TM_ALL_List.tmp

\\row.myacmp.com\Guides and Recources\MLP Mortgage\REPORTS\MJohnson Master Files\All Areas Management\Tract Master Main - 20131105 V4c_278.xlsx
\\row.myacmp.com\Guides and Recources\MLP Mortgage\REPORTS\MJohnson Master Files\All Areas Management\Tract Master Main - 20131105 V4c_279.xlsx
[U:\DosUtils\4nt]

=====================

How do I prevent TPIPE from reloading TCC and rerunning 4start (like grep does)?

--Peniel02
 
May 20, 2008
11,400
99
Syracuse, NY, USA
I see the same thing and I'm tempted to say that's just how TPIPE works (starting a transient TCC). But it does seem a little odd considering that TPIPE is internal and there are no (explicit) pipes. I imagine Rex will tell us what's going on.

Regardless of the explanation, you might want to put something like this at the beginning of TCSTART.BTM
Code:
IF %_PIPE == 1 .OR. %_TRANSIENT ==1 ( QUIT )
A pipe/transient instance of TCC will inherit much from it's parent TCC and there seems little reason to do much of what your TCSTART does in a pipe/transient instance.

Here, the screen doesn't clear. I suspect it clears for you because you ask it to in TCSTART.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
The transient TCC exists to TYPE a temp file created by TPIPE. I don't know why that's necessary, but here, that transient TCC has a command line like
Code:
d:\tc15\tcc.exe /c type TP14021.tmp

I noticed another behavior which seems to be a bug. With "ECHO Starting TCSTART" at the beginning of TCSTART.BTM, here's normal (?), expected behavior:
Code:
d:\tc15> type tccbatch.btm | tpipe /grep=3,0,0,0,0,1,0,0,"2008"
Starting TCSTART
Starting TCSTART
  echo If you are running Windows 8, 7, 2008, or Vista, you must first start a TCC

If I put "PAUSE & ECHO Starting TCSTART" at the beginning of TCSTART, I get this behavior:
Code:
d:\tc15> type tccbatch.btm | tpipe /grep=3,0,0,0,0,1,0,0,"2008"
Press any key when ready...
Starting TCSTART
Press any key when ready...
Starting TCSTART

d:\tc15>

There is no actual PAUSE and there's no output! What's up with that?
 
Dec 30, 2010
13
0
Vince,

You hit that nail right on the head. I wondered how to "detect" that activity, and now I know!! I have changed my TCStart.btm, 4start.btm and 4exit.btm (all were being invoked!) and added various forms of:

Code:
IF %_PIPE == 1 .OR. %_TRANSIENT ==1 ( QUIT )

and now, TCC behaves as desired! (I get the exact same 3 lines output as grep or sed now! WOOHOO! I can start playing with TPIPE and learnin' it more gooder!

Vince - YOU ROCK! - and thanks to everyone for jumping in with the support - much appreciated!

--Peniel02
 
May 29, 2008
571
4
Groton, CT
Or, if you don't want to eliminate ALL pipes from processing TCSTART, try this:
Code:
iff %@index["%cmdcmdline",/c type TP] gt 0 .and. %_pipe eq 1 then
  rem   TPIPE pipe process
  if %@regex[^TP\d+\.tmp$,%@word[-0,%cmdcmdline]] eq 1 quit
 endiff
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
How do I prevent TPIPE from reloading TCC and rerunning 4start (like grep does)?

TPIPE does not normally create a pipe (thereby invoking another child TCC process).

The internal TPIPE command invokes the external TPIPE.EXE app. If you do not specify an output file (or pipe the output somewhere else), TPIPE.EXE starts a secondary TCC shell using TYPE to dump the output to stdout.

So if you specify an output file (the normal behavior), you won't get the child process.
 
Similar threads
Thread starter Title Forum Replies Date
samintz How to? TPIPE /simple=61 Support 6
R Bug TPIPE's pdf to text conversions don't work Support 2
Kachupp How to? tpipe Support 4
H TPIPE /simple=4 Support 12
D TPIPE produces unwanted logs. Support 1
Kachupp How to? tpipe Support 8
vefatica Documentation TPIPE, /perl, DotMatchesNewLines Support 1
vefatica Stop TPIPE /EOL removing bad EOLs (and TPIPE changine EOLs)? Support 2
vefatica TPIPE in an alias? Support 2
C How to? TPIPE ?'s Support 2
H History and TPipe Oddness Support 3
Jay Sage Baffling Behavior With TPIPE Support 5
vefatica TPIPE: unbalanced escaped quotes in a regex? Support 5
Joe Caverly Multiple Text Searches at once using FFIND or TPIPE Support 4
Kachupp FFIND TPIPE Support 9
vefatica TPIPE and avarice? Support 5
Peter Murschall TPIPE generate unicode on Piping or redirecting Support 3
x13 TPIPE /REPLACE - Remove line (including EOL) Support 3
Charles Dye Documentation TPIPE /REPLACELIST Support 0
Joe Caverly TPIPE and /inputstring Support 3
vefatica How to? Add real <ESC> characters with TPIPE Support 2
vefatica How to? TPIPE ... see output right away? Support 4
vefatica TPIPE.EXE crashes on Ctrl-C Support 9
O TPIPE: Error -Can´t access textpipeengine.dll Support 24
vefatica Extract fields with TPIPE? Support 10
vefatica TPIPE, crash and question Support 1
MickeyF Another TPIPE question Support 6
MickeyF Can't get my TPIPE /replace to work Support 4
Joe Caverly Printing TPIPE documentation Support 3
C WAD tpipe /simple=28 Support 8
vefatica Remove double-quotes with TPIPE Support 4
vefatica TPIPE crashes on Ctrl-C Support 1
C How to? Add date/time to custom tpipe based BTM Support 1
C tpipe /simple=28 error Support 5
C TPipe /dup Support 5
T TPipe: Replacing String with Double Quotes Support 3
C tpipe and extract email addresses Support 1
vefatica How do I do this with TPIPE? Support 1
vefatica TPIPE's /perl option? Support 1
D TPIPE help typo Support 0
vefatica TPIPE access violations are back Support 2
Joe Caverly Word Count using TPIPE Support 10
Dan Glynhampton TPIPE in Build 41 Support 4
Phileosophos TPIPE doesn't work at all with v16 Support 3
vefatica TPIPE access violation again Support 1
David McClelland TPIPE matching problem Support 3
vefatica TPIPE: Access violation Support 5
jbanaszczyk TCMD 16 - TPIPE Support 4
Phileosophos Documentation TPIPE /string type code confusion Support 4
C TPIPE questions.... Support 5

Similar threads