Search found 2244 matches

by dbenham
18 Sep 2019 12:01
Forum: DOS Batch Forum
Topic: non-buffering FOR /F alternative
Replies: 2
Views: 41

Re: non-buffering FOR /F alternative

SET /P does not play nicely with pipes. However it does work as you want with files. So simply redirect your utility output to a temp file, and read the temp file with SET /P in an infinite loop. SET /P will return an empty string if there is no data waiting, so you need to ignore empty lines. This ...
by dbenham
18 Sep 2019 10:59
Forum: DOS Batch Forum
Topic: [Resolved] Alternative xcopy function to Choice - Carriage return as accepted character possible?
Replies: 3
Views: 74

Re: Alternative xcopy function to Choice - Carriage return as accepted character possible?

You might also want to look at :getKey and :getAnyKey that use REPLACE instead of XCOPY.

Both forms can return a value representing a carriage return, and have an option to specify valid characters, including Carriage Return.


Dave Benham
by dbenham
17 Sep 2019 16:50
Forum: DOS Batch Forum
Topic: Looking for a specific book
Replies: 16
Views: 514

Re: Looking for a specific book

Amen to both misol101 and ShadowThief.

Especially misol101 - I needed a good laugh.
by dbenham
13 Sep 2019 11:20
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 441
Views: 205230

Re: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets

Well that was an easy fix. I replaced version 8.3 with version 8.4

I also updated the main release to version 8.4 at the original post in this thread.

Thanks again MarzSyndrome - you were a big help.


Dave Benham
by dbenham
13 Sep 2019 05:42
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 441
Views: 205230

Re: JREPL.BAT v8.3 - regex text processor with support for text highlighting and alternate character sets

That is most definitely a serious bug :!: :cry:

Not sure how long it will take, but I will definitely fix that.

Thanks for reporting - please don't hesitate to report any suspect behavior in the future.


Dave Benham
by dbenham
08 Sep 2019 05:51
Forum: DOS Batch Forum
Topic: CALL myBatch.bat can return to the wrong place
Replies: 4
Views: 255

Re: CALL myBatch.bat can return to the wrong place

Very interesting discovery and technique. :shock: 8) I was worried about SETLOCAL not ending properly, but all seems to be good - all SETLOCAL within both the CALLer and the CALLed are properly ended. I recommend quoting your CALLed path just in case there are spaces or other problematic characters ...
by dbenham
07 Sep 2019 05:41
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 33
Views: 4905

Re: Closing parenthesis prevents escape of subsequent special character operator

Hi sst, I'm impressed by your analysis/debugging. :o :!: It explains so much. Ditto that But why it only drops the token, when a redirection is present :?: I'll take a stab at that. The redirection parser requires the file path, which may be in the next token. echo hello 2> one^ two^ three.txt worl...
by dbenham
06 Sep 2019 03:58
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 33
Views: 4905

Re: Closing parenthesis prevents escape of subsequent special character operator

sst wrote:
06 Sep 2019 00:02
I don't follow. Would you give an example?
From a few posts ago - viewtopic.php?f=3&t=8198&start=15#p60206

Dave Benham
by dbenham
03 Sep 2019 05:30
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 33
Views: 4905

Re: Closing parenthesis prevents escape of subsequent special character operator

6. The parser is at level 1 . It reads the next token( GeToken ) and compares it against the string "&" . The escaping will be done in the GeToken function so it will return "&" instead of "^&" and sets the token type to Literal Text (0x4000) but the operator parsing function (which is named Binary...
by dbenham
30 Aug 2019 21:29
Forum: DOS Batch Forum
Topic: Closing parenthesis prevents escape of subsequent special character operator
Replies: 33
Views: 4905

Re: Closing parenthesis prevents escape of subsequent special character operator

I stumbled upon this old post of mine, and I just realized the last behavior is identical to REM :shock: :!: If there is only one following token ending with escape and end of line, then the token is thrown away. This repeats until there is more than one token on the line, or the line doesn't end wi...
by dbenham
29 Aug 2019 11:24
Forum: DOS Batch Forum
Topic: Replace "!" in a variable value when delayed expansion is on
Replies: 7
Views: 1103

Re: Replace "!" in a variable value when delayed expansion is on

Bang is a term used in the computer industry to mean exclamation point. I believe it originated in the Unix world. The statement about characters before hand has to do with the mechanism (rules) used to parse/expand variables . Here is a demonstration: @echo off setlocal disableDelayedExpansion set ...
by dbenham
25 Aug 2019 11:30
Forum: DOS Batch Forum
Topic: VT100 escape sequences not working in Windows 10?
Replies: 7
Views: 815

Re: VT100 escape sequences not working in Windows 10?

If you are OK with displaying the file names on the top line, then there is no need for VT100 sequences. Simply do CLS & ECHO file. You can easily make your original code work on any line with a small change: set /p "=!CR! !CR!!filename!" < nul Just make sure the number of spaces between the to carr...
by dbenham
16 Aug 2019 13:54
Forum: DOS Batch Forum
Topic: Call bug using silent operator @
Replies: 2
Views: 1295

Re: Call bug using silent operator @

Developing a project related to batch I found that the CALL internal command has a bug. It not execute the command if you use the silent operator @. Yes - that is known behavior. We documented that in Phase 6 of the batch parsing rules at StackOverflow . There are a number of constructs that functi...
by dbenham
16 Aug 2019 06:46
Forum: DOS Batch Forum
Topic: Newly discovered pipe behavior - and a fun challenge!
Replies: 5
Views: 1864

Re: Newly discovered pipe behavior - and a fun challenge!

And so you did :!: :oops: You introduced a number of new concepts, and my brain was a bit overwhelmed. There are still a number of points I don't fully understand. I hope to revisit your posts and see if I can better absorb the info. For me, this is the key post where you point out the difference. I...
by dbenham
15 Aug 2019 12:38
Forum: DOS Batch Forum
Topic: Newly discovered pipe behavior - and a fun challenge!
Replies: 5
Views: 1864

Re: Newly discovered pipe behavior - and a fun challenge!

OMG! Adding one measly little CALL causes the output to balloon to 4145 bytes! echo(&echo 12) break ^| (cmd /v:on /c call echo %%%%cmdcmdline%%%% %%%%cmdcmdline%%%%) break | (cmd /v:on /c call echo %%cmdcmdline%% %%cmdcmdline%%) --OUTPUT-- 12) break | (cmd /v:on /c call echo %%cmdcmdline%% %%cmdcmdl...