Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Can't disable internal tar, at least in pipes

Oct
73
1
I use a lot of ported Linux tools, so I have tar disabled in my TCSTART file, using setdos /i-tar
but tar comes back alive in pipes.

For example:
setdos /i-tar
which tar
tar is an external : C:\Bin\tar.exe

zcat acronyms.tar.Z | tar tv | less
Usage : TAR [A:[[-][+]rhsdaecjot] /A /C /D /F /G /M /O:[-]adegnrstu /P /Q /R /TEST /U /V] tararchive [@file] file...

zcat: stdout: Broken pipe

The usage message is from the built-in tar which should be disabled. By adding the path to the external tar, it works as expected:
zcat acronyms.tar.Z | c:\bin\tar tv | less
-rwSr-Sr-- bgy2a36/tnmusr 23957 2000-05-01 12:27 tmp/acroa.htm
-rwSr-Sr-- bgy2a36/tnmusr 20930 2000-05-01 12:27 tmp/acrob.htm
-rwSr-Sr-- bgy2a36/tnmusr 35369 2000-05-01 12:28 tmp/acroc.htm
-rwSr-Sr-- bgy2a36/tnmusr 21979 2000-05-01 12:28 tmp/acrod.htm
-rwSr-Sr-- bgy2a36/tnmusr 19065 2000-05-01 12:28 tmp/acroe.htm
-rwSr-Sr-- bgy2a36/tnmusr 14880 2000-05-01 12:28 tmp/acrof.htm
-rwSr-Sr-- bgy2a36/tnmusr 8541 2000-05-01 12:28 tmp/acrog.htm
-rwSr-Sr-- bgy2a36/tnmusr 7887 2000-05-01 12:30 tmp/acroh.htm
-rwSr-Sr-- bgy2a36/tnmusr 19939 2000-05-01 12:31 tmp/acroi.htm
-rwSr-Sr-- bgy2a36/tnmusr 4604 2000-05-01 12:31 tmp/acroj.htm
-rwSr-Sr-- bgy2a36/tnmusr 4532 2000-05-01 12:31 tmp/acrok.htm
-rwSr-Sr-- bgy2a36/tnmusr 14440 2000-05-01 12:31 tmp/acrol.htm
-rwSr-Sr-- bgy2a36/tnmusr 22405 2000-05-01 12:32 tmp/acrom.htm

I'm running TCC version 20.11.40 on Windows 10
 
What's in your TCSTART.BTM file? The first line of mine checks if TCC is running in a pipe and doesn't do the extra stuff.
Code:
if %_pipe != 0 .or. %_transient != 0 .or. %_ide != 0 quit
 
I'll bet Scott's right. With "setdos /i-tar" in the wrong place in TCSTART.BTM I got
Code:
v:\> echo foo | which tar
tar is an internal command

When I moved it (so it happened for EVERY instance) I got

Code:
v:\> echo foo | which tar
tar is an external : G:\uty\tar.EXE
 
Thanks. That was the problem, but it's the first time I ran into it. When I wrote the TCSTART the was no builtin tar. I'm not too thrilled with adding common utilities to TCC -- especially aggravating was zip and unzip..

It seems to me that setdos options should be set semi-permanently, and only reset when a command returns to the prompt. Resetting in a pipe is not intuitive, in my opinion.

I think TCC has become too complex for me. I find it impossible to keep up with the changes. I don't want the command processor to require more attention than my real work. :)
 
Back
Top
[FOX] Ultimate Translator
Translate