Welcome!

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

SignUp Now!

Alias works differenltly v16 vs. v17

May
12,845
164
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:\>
 
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
 
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?
 
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
 
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!
 
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?
 
??? 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.
 
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^$
 
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

Back
Top