Welcome!

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

SignUp Now!

':' and ^t

May
12,846
164
The escape sequence for a tab doesn't seem to get along with a colon very well.
Code:
v:\> set a=1

v:\> set b=2

v:\> echo %a^t%b
1  2

v:\> echo %a:^t%b
1:t2

v:\> echo %a: ^t%b
1: t2

v:\> echo %a: ^t %b
1: t 2
 
Two possible work-arounds:
Code:
echo %a:%@char[9]%b
1:      2

echo %a:^^t%b
1:      2
 
You're bumping into a compatibility kludge to support some gawdawful CMD.EXE syntax. Try one of:

Code:
echo %a%:^t%b
echo %[a]:^t%b
 
Other escape sequences too.
Code:
v:\> echo %name:^t%myname
Name:tVincent

v:\> echo %name:^b%myname
Name:bVincent

v:\> echo %name:^n%myname
Name:nVincent
 
Thanks! (How foolish of me!)

It's probably not possible for anyone to remember all the horrors that Microsoft has perpetrated. The capacity of the human brain has been estimated at around 2.5 petabytes.
 
It's probably not possible for anyone to remember all the horrors that Microsoft has perpetrated. The capacity of the human brain has been estimated at around 2.5 petabytes.
That's why I had suggested many versions ago that there be a wholly logical and consistent TCC language with no accommodations for CMD, unless the "duplicate CMD bugs" is set. What is esp. horrible is when old batch files and aliases no longer work to help CMD users. I now suspect that the same issue as Vince observed is plaguing me with the <EscapeChar>r sequence, though without loading all normal files it does work. I still need to find what kills it.
 
That's why I had suggested many versions ago that there be a wholly logical and consistent TCC language with no accommodations for CMD, unless the "duplicate CMD bugs" is set. What is esp. horrible is when old batch files and aliases no longer work to help CMD users. I now suspect that the same issue as Vince observed is plaguing me with the <EscapeChar>r sequence, though without loading all normal files it does work. I still need to find what kills it.

Since this syntax has been around for years, I don't think there's going to be any issue with old TCC batch files not working. I don't think your escape character issues are related.
 
Back
Top