1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

':' and ^t

Discussion in 'Support' started by vefatica, Jan 9, 2014.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,971
    Likes Received:
    30
    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
     
  2. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,191
    Likes Received:
    11
    Two possible work-arounds:
    Code:
    echo %a:%@char[9]%b
    1:      2
    
    echo %a:^^t%b
    1:      2
    
     
  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,312
    Likes Received:
    39
    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
    
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,971
    Likes Received:
    30
    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
     
  5. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,971
    Likes Received:
    30
    Thanks! (How foolish of me!)
     
  6. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,312
    Likes Received:
    39
    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.
     
  7. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    See CMD.EXE's (bizarre) string substitution syntax.
     
  8. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    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.
     
  9. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,870
    Likes Received:
    83
    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.
     

Share This Page