Search found 1952 matches

by dbenham
16 Jan 2018 22:26
Forum: DOS Batch Forum
Topic: jTimestamp.bat date/time utility v2.1 - Replacement for getTimestamp.bat
Replies: 17
Views: 2807

Re: jTimestamp.bat date/time utility v2.1 - Replacement for getTimestamp.bat

I got a private message from user asun reporting a nasty bug with ISO 8601 week date computation Hi Dave, I was looking for a DOS batch function that will give me the date of a given week number and day and your JTimestamp.bat is just what I need! Thank you for writing and posting this code. However...
by dbenham
14 Jan 2018 23:53
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 41
Views: 10309

Re: Rules for label names vs GOTO and CALL

I have confirmed that <CR> functions as a stop character in all cases - for a CALL name, a GOTO name, and also for the label name when scanning for the label. I also believe I have discovered the source of the "bug" that leads to the "anonymous" CALL behavior that npocmaka discovered. When CALL exec...
by dbenham
10 Jan 2018 09:56
Forum: DOS Batch Forum
Topic: JREPL.BAT v7.9 - regex text processor now with Unicode and XRegExp support
Replies: 348
Views: 88052

Re: JREPL.BAT v7.9 - regex text processor now with Unicode and XRegExp support

A full description of error return codes, like everything else, is included in the built in help. To get a description of the return codes: prompt>jrepl /?return Possible ERRORLEVEL Return Codes: If /? was used, and no other argument 0 = Only possible return If /MATCH, /JMATCH, /JMATCHQ, /K, and /R ...
by dbenham
09 Jan 2018 06:28
Forum: DOS Batch Forum
Topic: JREPL.BAT v7.9 - regex text processor now with Unicode and XRegExp support
Replies: 348
Views: 88052

Re: JREPL.BAT v7.9 - regex text processor now with Unicode and XRegExp support

Looks good :) Currently the parentheses are not doing anything useful, but they are doing no harm either. It would work just as well if you did: call "%~dp0jrepl.bat" "^Environment=.+$" "Environment=UAT1-v6.19.13.0" /I /F "PropertyFile.txt" /O - Or, with parentheses, you can save a bit of typing - $...
by dbenham
05 Jan 2018 07:49
Forum: DOS Batch Forum
Topic: JREPL.BAT v7.9 - regex text processor now with Unicode and XRegExp support
Replies: 348
Views: 88052

Re: JREPL.BAT v7.9 - regex text processor now with Unicode and XRegExp support

@naraen87 I must say it is disappointing you haven't demonstrated any effort at understanding regular expressions, or countless existing examples on JREPL usage. Your situation is about as simple a use case as there is. Imagine you are the program that must change the value - how would you do it? Wh...
by dbenham
31 Dec 2017 23:08
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 41
Views: 10309

Re: Rules for label names vs GOTO and CALL

At some point I'd like to get a single comprehensive post that describes all the ins and outs of :label parsing and CALL and GOTO behavior. I see a couple things that don't look correct in jeb's first post: Now the label names. They also use STOP characters, but not the same, I only know two :!: :+ ...
by dbenham
30 Dec 2017 08:53
Forum: DOS Batch Forum
Topic: CONVERTCP.exe - Convert text from one code page to another
Replies: 33
Views: 7888

Re: CONVERTCP.exe - Convert text from one code page to another

Out of curiosity, how did you solve the problem :?:

Did you remove the "feature" of - options?

Or did you come up with a mechanism for differentiating - option from file name beginning with - ? (Perhaps differentiating quoted vs. unquoted)


Dave
by dbenham
29 Dec 2017 15:46
Forum: DOS Batch Forum
Topic: Examination of Linefeeds with CALL
Replies: 11
Views: 1212

Re: Examination of Linefeeds with CALL

Not sure how this fits into existing theories, but I investigated what happens if \n follows immediately after CALL. @echo off setlocal EnableDelayedExpansion (set \n=^ %=empty=% ) set "caret=^" prompt batch$g echo on rem This works call %%caret%%%%\n%%echo OK rem The rest do nothing call %%caret%%!...
by dbenham
27 Dec 2017 00:55
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 17
Views: 679

Re: Closing parenthesis prevents escape of subsequent special character operator

Wow, it almost doesn't matter what characters appear within the intermediate continued lines, as long as each line contains a single token. All intermediate lines are ignored :!: prompt>(call )^ More? This^ More? is^ More? all^ More? ignored^ More? &echo This is executed This is executed Token delim...
by dbenham
26 Dec 2017 06:44
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 17
Views: 679

Re: Closing parenthesis prevents escape of subsequent special character operator

I just looked closer at penpen's tests in post #8 , and it is totally bizare :!: The first & is getting stripped, so && is functioning as simple command concatenation, not as conditional command concatenation. Here is my proof. First I'll show normal expected behavior of && and ||. The HELP command ...
by dbenham
26 Dec 2017 05:57
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 17
Views: 679

Re: Closing parenthesis prevents escape of subsequent special character operator

Curiouser and curiouser :!: Test 2 is an "expected" failure of an escaped ampersand But how pray tell is Test 5 working :?: :shock: prompt>echo 1: Expected behavior - 1st character of continued line is escaped ^ More? & so this is all part of ECHO statement 1: Expected behavior - 1st character of co...
by dbenham
25 Dec 2017 13:32
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 17
Views: 679

Re: Closing parenthesis prevents escape of subsequent special character operator

There is nothing new about REM. or REM^<space> or any of the other variants. https://www.dostips.com/forum/viewtopic.php?p=3500#p3500 If you want to put a remark within a macro, then I much prefer the %= REMARK HERE =% syntax, as it only appears in the batch code, and is not reflected in the macro d...
by dbenham
25 Dec 2017 09:29
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 17
Views: 679

Re: Closing parenthesis prevents escape of subsequent special character operator

@penpen - I'm not able to follow the logic of your theory enough to draw any conclusion. But I have stumbled on some new interesting variants. prompt>(rem.) ^& echo escape failed escape failed prompt>(rem.) ^&echo escape succeeded &echo was unexpected at this time. prompt>(rem.) ^&^& echo escape fai...
by dbenham
18 Dec 2017 22:34
Forum: DOS Batch Forum
Topic: using %errorlevel% or %something% in a compound batch command ()
Replies: 11
Views: 200

Re: using %errorlevel% or %something% in a compound batch command ()

Another command line option: dir /b notfound.txt & call echo %^errorlevel% CALL introduces a 2nd round of expansion, and unlike batch, expansion of an undefined variable preserves the code rather expanding to nothing. The caret is considered part of the name, so it is not found, and then the caret i...
by dbenham
13 Dec 2017 21:07
Forum: DOS Batch Forum
Topic: Undocumented FINDSTR features and limitations
Replies: 29
Views: 15981

Re: Undocumented FINDSTR features and limitations

The explanation is within the italicized portions of the following quote from the 2nd answer in my SO Q&A :' Regex word boundary \< must be the very first term in the regex. The regex will not match anything if any other characters precede it. \< corresponds to either the very beginning of the input...