@replace -- what is wrong here

Aug 30, 2016
5
0
This is a slightly cleaned up printout from the screen:
--------------------------------------------------------------------------
s:\x>ver
TCC 24.00.24 x64 Windows 10 [Version 10.0.17134.471]

s:\x>dir
...
12/11/2018 14:46 5,047,695 IMG_1981.JPG
12/11/2018 14:47 5,220,796 IMG_1982.JPG
12/11/2018 14:47 4,889,711 IMG_1983.JPG
..

s:\x>for %f in (img*) echo %@replace[img,xyz,%f]
IMG_1981.JPG
IMG_1982.JPG
IMG_1983.JPG

s:\x>for %f in (img*) echo %@replace[img,xyz,img_123]
xyz_123
xyz_123
xyz_123
--------------------------------------------

Why @replace in the first 'for' didn't replace 'img' with 'xyz' ?
It worked in the second 'for' command for the constant string.
The first 'for' listed all img* files, so we know that '%f' is being expanded, but @replace didn't do its job.

Am I doing something wrong here?

Thanks,
Tom
 
Similar threads
Thread starter Title Forum Replies Date
Joe Caverly Documentation Replace internal command with LIBRARY command Support 0
I how to make TCC default/replace cmd.exe? Support 9
x13 TPIPE /REPLACE - Remove line (including EOL) Support 3
C Replace 1st argument on command line Support 4
R How to? Replace in Rename Support 9
C How to? @replace[a comma,_,filename] Support 5
MickeyF Can't get my TPIPE /replace to work Support 4
C @replace and @xreplace problems Support 5
C How to? Replace &'s in filenames / FixNames.dll Support 2
M I'm unable to use @replace[] with a % character in string2 Support 12
MikeBaas Strange prob with %@replace.. Support 4
vefatica Back-refs in TPIPE's /replace's replacement string? Support 2
Frank @replace works case sensitive Support 5
J @replace weirdness Support 1
vefatica TPIPE /replace? Support 3
Stefano Piccardi replace tcc process space? Support 8
vefatica @SUBST ... how replace character with a caret? Support 9
mdwyer @replace - global use in a text file Support 3
B Regex and Replace Support 6
B REPLACE is good news Support 0
J Problem with %var:find=replace% syntax Support 5
JohnQSmith New online help file wrong logo Support 7
vefatica @EXECSTR ... TCSTART ... something's wrong! Support 7
R History window wrong size, can't remember size change Support 12
mfarah Fixed The DATE command produces the wrong error message. Support 1
MikeBaas @regsetenv complains "wrong parameter" Support 14
mikea How to? TCC registered to wrong 'entity' Support 5
vefatica Fixed KEYSTACK /i with repeat count sends wrong keys Support 7
C ZIP/U compares wrong timestamp Support 13
vefatica @WORDS, often wrong Support 0
vefatica gcd() ... wrong answer, lcm() hangs Support 5
D What is wrong with this code? Support 7
vefatica WAD DIR /HL still gets names wrong Support 16
H Fixed DIR /G returns wrong sizes Support 2
M Another "What is wrong?" Support 8
M What is wrong with this command? Support 4
vefatica Updater says wrong version Support 1
CWBillow Wrong icons keep sticking Support 6
M How to? What am I doing wrong/not understanding? Support 10
C News link wrong Support 1
M What am I doing wrong? Support 12
M What am I doing wrong here? Support 2
C Forum column headings wrong? Support 4
gschizas Installation folder for TCMD x64 15.1 is wrong Support 5
Dan Glynhampton Documentation v15 help: ECHOXERR Help Page Title is Wrong Support 0
M What am I doing wrong in this (very simple!) code? Support 3
vefatica Something wrong with @PID Support 10
J zip wrong central directory signature Support 12
S Fixed _DO_FILES and _DO_DIRS wrong Support 0
B Downloading Updates - Error: Wrong file size?? Support 3

Similar threads