Search found 848 matches

by jeb
06 Feb 2018 04:09
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 38
Views: 844

Re: Discussion about jeb's batch parsing rules on StackOverflow

3) The odd phase 7 ECHO behavior that jeb discovered regarding <LF> <CR> and <NBSP> does not work on all machines :shock: :evil: For this discussion, I will call the odd behavior "Extended ECHO" I tested jeb's script on 3 machines, and I was only able to reproduce his Extended ECHO results on one o...
by jeb
02 Feb 2018 01:55
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 38
Views: 844

Re: Discussion about jeb's batch parsing rules on StackOverflow

Your !var:~,7! expansion is broken because you forgot to escape the comma, so the expression is split between the command token and the arguments token in phase 2. Exactly that was my intention, to simply detect, if the character between ECHO and !var is a phase 2 delimiter. This led me to discover...
by jeb
31 Jan 2018 16:19
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 38
Views: 844

Re: Discussion about jeb's batch parsing rules on StackOverflow

I don't understand why MS wrote cmd.exe that way. But my rules do predict the behavior. Yes, the rules seem to be accurate to explain how it works. But I can't believe that a sane human would code it that way. I suppose, that the behaviour is only a side effect of some parts we currently don't know...
by jeb
31 Jan 2018 13:12
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 38
Views: 844

Re: Discussion about jeb's batch parsing rules on StackOverflow

Good point I pretty much concluded the same thing at Re: ECHO. FAILS to give text or blank line - Instead use ECHO/ dbenham wrote: When ECHO sees ;/? or ,/? or =/? it sees a token delimiter and then a string beginning with help option. So it prints help. But (/? does not start with a token delimiter...
by jeb
31 Jan 2018 12:12
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 38
Views: 844

Re: Discussion about jeb's batch parsing rules on StackOverflow

Now when it's clear, I found also some examples to demonstrate the token splitting even without debug mode. @echo off setlocal EnableDelayedExpansion set var=##### echo]!var! ^^^^ #1 echo(!var! ^^^^ #2 ##### ^^ #1 ##### ^ #2 In the first example the carets are only reduced by phase 2, but not by pha...
by jeb
31 Jan 2018 10:45
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 38
Views: 844

Re: Discussion about jeb's batch parsing rules on StackOverflow

Thanks penpen for the idea to test with the debug mode. I tested it with echo ###1 echo(###2 echo (###3 echo[###4 echo=###5 I only show the relevant parts Cmd: echo Type: 0 Args: ` ###1' Cmd: echo Type: 0 Args: `(###2' Cmd: echo Type: 0 Args: ` (###3' Cmd: echo[###4 Type: 0 Cmd: echo Type: 0 Args: `...
by jeb
30 Jan 2018 09:37
Forum: DOS Batch Forum
Topic: ECHO. FAILS to give text or blank line - Instead use ECHO/
Replies: 38
Views: 60318

Re: ECHO. FAILS to give text or blank line - Instead use ECHO/

A safe character to follow ECHO should be any token delimiter that is not white space. That leads me to predict that all of the following should be good: Code: Select all echo( echo= echo, echo; But ( is only a command Quite a nice try :wink:, but not safe for content. echo(/? echo=/? echo,/? echo;...
by jeb
30 Jan 2018 05:58
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 38
Views: 844

Re: Discussion about jeb's batch parsing rules on StackOverflow

One critical thing I have discovered about phase 2 - A left paren ( functions as a token delimiter when parsing the command token :!: Yes, I know and I suppose I wrote something about that fact, as I assume that "echo(" got his special abillities from exactly there. The next test works with "ECHO["...
by jeb
30 Jan 2018 02:40
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 38
Views: 844

Re: Discussion about jeb's batch parsing rules on StackOverflow

dbenham wrote: ↑ Fri Jan 26, 2018 2:29 pm Did jeb get this wrong :?: Or does the behavior described by jeb only apply to Win XP :?: Or ... :?: :? I tested the above with (a virtual machine) WinXP, SP3, x86: There the behaviour is as jeb described. I get different results than penpen. I retested it ...
by jeb
26 Jan 2018 01:27
Forum: DOS Batch Forum
Topic: Discussion about jeb's batch parsing rules on StackOverflow
Replies: 38
Views: 844

Re: Discussion about jeb's batch parsing rules on StackOverflow

1) Should phases 3 and 4 be reversed? The echoing of parsed commands (phase 3) occurs at two points: after the initial round of phase 2 (main parser), and then again after each round of phase 4 (FOR variable expansion for each DO iteration). I think the logic would be much simpler to describe if th...
by jeb
25 Jan 2018 07:56
Forum: DOS Batch Forum
Topic: Detect echo state without temporary file
Replies: 7
Views: 238

Re: Detect echo state without temporary file

No need for that. Code: Select all for /f "tokens=1,2 delims=: " %%A in ('mode con ^| findstr "Lines Columns"') do set %%A=%%B Okay, that's really simple :o Does that need to be adjusted for language? Also, does the output of ECHO or VERIFY or KEYS change with language? For ECHO it's irrelevant, as...
by jeb
25 Jan 2018 05:56
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 47
Views: 11112

Re: Rules for label names vs GOTO and CALL

Hi Dave, great work :!: But some annotations. When scanning the file for the label name, I see that there are 5 (maybe 6) stop characters for the label name instead of two: <+>, <:>, <space>, <tab>, <LF>, and possibly <CR>. The other token delimiters are not stop characters I retested and I came to ...
by jeb
25 Jan 2018 02:57
Forum: DOS Batch Forum
Topic: Detect echo state without temporary file
Replies: 7
Views: 238

Re: Detect echo state without temporary file

Very interesting and ingenious, but I think a temp file is both more practical and probably faster. Yes, currently it's only a proof of concept, perhaps it can be improved with other ideas. Your idea is also very good, how to test VERIFY and KEYS, and obviously :D it still can work. You only have t...
by jeb
24 Jan 2018 09:55
Forum: DOS Batch Forum
Topic: Detect echo state without temporary file
Replies: 7
Views: 238

Detect echo state without temporary file

Until now it wasn't possible to detect the echo state without a temporary file. The main problem is, that fetching the current state doesn't work neither with FOR nor with pipes as both invoke a new cmd.exe instance where the echo state is resetted. The current working solution is to redirect the ou...
by jeb
18 Jan 2018 13:18
Forum: DOS Batch Forum
Topic: Rules for label names vs GOTO and CALL
Replies: 47
Views: 11112

Re: Rules for label names vs GOTO and CALL

I didn't think of testing it in the command line context. That was an interresting idea. But I get other results than you. Tested on the command line echo Original > out.txt > out.txt :label & dir out.txt I get Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsc...