Alias works differenltly v16 vs. v17

May 20, 2008
11,415
99
Syracuse, NY, USA
I used this command to create an alias.
Code:
alias get `grep ^^^^%1^^$ u:\lib\words`
It looks the same in v16 and v17 but it works differently (expected result in v16, nothing in v17).
Code:
v:\> ver & which get & get b.ld

TCC  16.03.55  Windows 7 [Version 6.1.7601]
get is an alias : grep ^^%1^$ u:\lib\words
bald
beld
bold

v:\>
Code:
v:\> ver & which get & get b.ld

TCC  17.00.42  Windows 7 [Version 6.1.7601]
get is an alias : grep ^^%1^$ u:\lib\words

v:\>
 
May 20, 2008
11,415
99
Syracuse, NY, USA
Here's the difference:
Code:
v:\> ver & which get & get b.ld

TCC  16.03.55  Windows 7 [Version 6.1.7601]
get is an alias : u:\echoargs.exe ^^%1^$ u:\lib\words
u:\echoargs.exe
^b.ld$
u:\lib\words
Code:
v:\> ver & which get & get b.ld

TCC  17.00.42  Windows 7 [Version 6.1.7601]
get is an alias : u:\echoargs.exe ^^%1^$ u:\lib\words
u:\echoargs.exe
^^b.ld^$
u:\lib\words
 
May 20, 2008
11,415
99
Syracuse, NY, USA
I have no idea what you're trying to do here. But I don't think v17 would need as many escape chars (part of the parser simplification).
It's simple. I want "^%1$" sent to grep at its first argument with or without the double quotes. Can I do that with an alias that will work with v16 and v17?
 
May 20, 2008
11,415
99
Syracuse, NY, USA
Not unless you want me to reintroduce the old parser (that you never understood, and where you had to keep adding escapes randomly until something worked).
Doesn't that incompatibility bother you?

OK, is there **ANY** alias that will work in v17 and that will sent "^%1$" to an app as an argument? These don't work:

Here, %1 is not expanded.
Code:
v:\> which get & get b.rb
get is an alias : u:\echoargs.exe ^%1$ u:\lib\words
u:\echoargs.exe
^%1$
u:\lib\words
b.rb
Here, the double "^^" is passed and the '$' is missing!
Code:
v:\> which get & get b.rb
get is an alias : u:\echoargs.exe ^^%1$ u:\lib\words
u:\echoargs.exe
^^b.rb
u:\lib\words
 
May 20, 2008
11,415
99
Syracuse, NY, USA
Get it? I want %1 to be expanded, prefixed with '^', and postfixed with '$'. I've used that alias many times a day for many years!
 

rconn

Administrator
Staff member
May 14, 2008
12,364
150
Doesn't that incompatibility bother you?

Please clarify this -- you want me to dumbify the v17 parser in the name of compatibility, in order to emulate the v16 parser's escape character handling (which you complained about loudly and often), for the sake of an extremely tiny minority of users that have been inserting "^^^^^^^" in their aliases?

And you also want me to break a much larger set of aliases & batch files that are using COPY, because you don't care about compatibility with v16?
 
May 20, 2008
11,415
99
Syracuse, NY, USA
??? And you've been running v17 for several months and didn't notice that it wasn't working ???
Yes.

All that escaping was tedious, but it did allow things to get done.

Please tell me how, with an alias, to have %1 expanded, prefixed with '^', postfixed with '$', and sent to a program as an arg.
 
May 20, 2008
11,415
99
Syracuse, NY, USA
You can't even do it in a BTM file! Something is very wrong.
Code:
v:\> type escape.btm
u:\echoargs ^^%1^$

v:\> escape.btm foo
u:\echoargs
^^foo^$
 
Jun 8, 2013
98
0
Warsaw, Poland
Please clarify this -- you want me to dumbify the v17 parser in the name of compatibility, in order to emulate the v16 parser's escape character handling (which you complained about loudly and often), for the sake of an extremely tiny minority of users that have been inserting "^^^^^^^" in their aliases?
I'm using this strange syntax (about 5 aliases). And for me compatibility is important: I'm using TCC/LE at work, TCC at home.
 
I have different OSes and different versions of TCMD at work and at home.
My alias definitions are in in TCSTART.btm, and there are a few IFs in order to adapt to differences while still using the same alias names (both command and directory aliases): different disk drives, different screen sizes, different software installed, software installed in different places, different support from TCC (new features such as CD/D, PATH/N, PROMPT ~).
 
Similar threads
Thread starter Title Forum Replies Date
D Alias with setdos no longer works Support 21
K Ctrl-D alias no longer works Support 4
D Can alias pass parameters to for command? Support 3
Jay Sage Issue with CD_ENTER Alias Support 37
Jay Sage Issue with CD_LEAVE Alias Support 3
Jay Sage WAD Failure of Alias Command with /Z Option Support 14
R @select inside alias gives different (insanely small) window Support 7
kb6ojs ALIAS with multiple commands? Support 9
vefatica Can I alias @@Ctrl-Shift-Alt-u? Support 4
vefatica TPIPE in an alias? Support 2
Peter Murschall TCC V26.01.3x Debugging has problems with Alias /R Support 1
Peter Murschall CMDebug 26.01.37 has problems with Alias Support 21
samintz How to? Alias or prompt? Support 1
MickeyF expand alias in cmdline with Ctrl-F in TCC Support 21
Jay Sage Directory Alias Access to FTP Servers Support 2
rps How to? Shralias and producing history.sav, alias.sav .. Support 6
J Alias @@F5 hotkey Support 2
vefatica alias.sav not accurate Support 8
Joe Caverly Using a Directory Alias with @iniwrite fails Support 14
N multiple command alias and redirection Support 0
vefatica SETLOCAL ... ALIAS ... pipes Support 2
B TCC 21.01.50 Problem with ALIAS /r and SET /r Support 2
rps How to? Alias/Command line use of *log on/off Support 2
MickeyF alias terminating before it should Support 3
JohnQSmith ALIAS /R in TCSTART.BTM Support 9
D Alias in batch file Support 3
vefatica Can't execute @ALIAS[...] Support 5
E How to? Load Alias File on Startup Support 3
I Windows 10 console does not allow alt-F4 alias to complete Support 1
MickeyF create an alias with optional parameter Support 4
nickles Alias expansion Support 7
T scrput `` in alias or function Support 2
B Alias with multi line definitions not assigned Support 6
jbanaszczyk Alias with space in the name Support 3
jbanaszczyk Alias for internal command Support 8
D Clear alias parameters Support 7
T Fixed multi-line alias issue Support 13
keithg1964 WAD 16.0027 Alias /rz bug Support 8
R In addition to ALIAS /Z and FUNCTION /Z, HISTORY /Z? Support 1
tmaynard How to? Control-U alias for Escape (command line editing) Support 5
C Alias ListEmptyFldrs=??? Support 4
M How to? Put logic into an alias... Support 6
G How to? v15: Can't alias Alt-Z Support 7
nikbackm v15: Problem with ALIAS in command group Support 10
vefatica WAD DO i=1 TO %# in an alias? Support 9
cgunhouse Directory Alias Issue Support 7
C CMD window size and post_exec alias ? Support 6
deleyd How to? Alias in TCMD.INI file? Support 2
M How to? Run a command (alias, actually) on a "timed" basis... Support 13
A strange error in alias Support 9

Similar threads