Search found 470 matches
- 06 Apr 2014 00:41
- Forum: DOS Batch Forum
- Topic: REPLVAR.BAT - regex search and replace for variables
- Replies: 32
- Views: 33338
Re: REPLVAR.BAT - regex search and replace for variables
The really weird thing is, I can write the final result to stderr, but when I try to write the same final string to stdout it throws the exception. That's odd, indeed. However, something still breaks underneath, since if I just replace "stdout" with "stderr" on the last line the...
- 05 Apr 2014 22:51
- Forum: DOS Batch Forum
- Topic: REPLVAR.BAT - regex search and replace for variables
- Replies: 32
- Views: 33338
Re: REPLVAR.BAT - regex search and replace for variables
My REPL.BAT utility was primarily built to work with files (via pipes or redirection), but it also supports input via an environment variable. [...] I decided to build a dedicated REPLVAR.BAT hybrid JScript/batch utility [...] It has most of the same options as REPL.BAT, except input is always from...
- 05 Apr 2014 22:12
- Forum: DOS Batch Forum
- Topic: Why []{}'`+ are considered as special characters ?
- Replies: 11
- Views: 9409
Re: Why []{}'`+ are considered as special characters ?
The excerpt from `CMD /?` output (concerning file completion I suppose) In the context, it seems to refer to file completion, only. Don't think it's about internal commands - otherwise many more characters would be in the list such as "-" (set/a), "$" (prompt) etc. I don't think...
- 28 Mar 2014 20:19
- Forum: DOS Batch Forum
- Topic: TextToHtml.bat - Easily create World Wide Web pages!
- Replies: 44
- Views: 39967
Re: TextToHtml.bat - Easily create World Wide Web pages!
I just downloaded it again from your link in this post and it is 47,560 bytes. I get 47,560 as well if I click the DOWNLOAD button, but that saves the file as UTF-8 (without BOM). Guess it must have something to do with pastebin's identification of the file type and/or encoding in the download scri...
- 28 Mar 2014 18:53
- Forum: DOS Batch Forum
- Topic: TextToHtml.bat - Easily create World Wide Web pages!
- Replies: 44
- Views: 39967
Re: TextToHtml.bat - Easily create World Wide Web pages!
I am very interested in know what is the difference that caused that I got a certain result, but at least two users (foxidrive and Matt Williamson) got a different result from the same procedure. I guess the difference must be in the procedure. It's fairly easy to mix/mess up encodings by accident....
- 27 Mar 2014 00:45
- Forum: DOS Batch Forum
- Topic: Macro to return multiple variables across endlocal barriers
- Replies: 0
- Views: 6598
Macro to return multiple variables across endlocal barriers
...LF-free variables, actually, but couldn't fit that in the title within the max length the board allows. I didn't find much prior art on the topic, and - honest - didn't fully follow Ed's http://www.dostips.com/forum/viewtopic.php?p=30315#p30315 . So here is my shot at such a macro. It doesn't do ...
- 17 Mar 2014 18:59
- Forum: DOS Batch Forum
- Topic: NOP+nested code.
- Replies: 25
- Views: 17852
Re: NOP+nested code.
How do you see the command title suffers from a problem when using code with pipe. I didn't really follow that through. Anyway, I don't think title is a plausible candidate for a NOP, so it's not of much practical interest. Unrelated, but I don't think 'break' is a good NOP candidate, either. The h...
- 17 Mar 2014 01:15
- Forum: DOS Batch Forum
- Topic: NOP+nested code.
- Replies: 25
- Views: 17852
Re: NOP+nested code.
I have done some tests Not entirely sure what your tests are meant to measure. If it's just about the raw performance of different NOPs then the if/echo/break alone will introduce noise unrelated to the actual NOP being measured. i have removed the comment but the problem remain: Haven't followed y...
- 15 Mar 2014 00:43
- Forum: DOS Batch Forum
- Topic: NOP+nested code.
- Replies: 25
- Views: 17852
Re: NOP+nested code.
You may add a double colon to rem, so the special keys are working, and the rest of the line should not be ignored anymore: if 0==0 (rem:) else echo 1 if 0==1 (rem:) else echo 0 Not sure what you mean by " so the special keys are working " but the (rem:) trick is neat regardless Still, it...
- 05 Mar 2014 17:23
- Forum: DOS Batch Forum
- Topic: For/if parsing under delayedExpansion vs. general rules
- Replies: 14
- Views: 13874
Re: For/if parsing under delayedExpansion vs. general rules
If lexer and parser are more interconnected, than thought Lexer and parser? My picture of the cmd source code is more like a bowl of spaghetti If the tokens are organized in a tree (default: parse tree), then it could be that the token type of the first child token is diplayed as a character That's...
- 03 Mar 2014 20:32
- Forum: DOS Batch Forum
- Topic: For/if parsing under delayedExpansion vs. general rules
- Replies: 14
- Views: 13874
Re: For/if parsing under delayedExpansion vs. general rules
Yes, you rediscovered something jeb ran into back in 2011: http://www.dostips.com/forum/viewtopic.php?p=8407#p8407 Thanks for the pointer. It's another proof of call's unpredictable clumsiness - equally fascinating, but still not quite the same thing. Those cases all revolve around parenthesized ca...
- 03 Mar 2014 19:18
- Forum: DOS Batch Forum
- Topic: For/if parsing under delayedExpansion vs. general rules
- Replies: 14
- Views: 13874
Re: For/if parsing under delayedExpansion vs. general rules
what is causing the characters [...] Only one seems to be clear, it is the type of the if processed... . Think I can fill in the missing value in your sequence ::6 call if not cmdextversion 1 else call if not defined cd else call if not errorlevel 1 else call if not 1==1 else That said, I don't kno...
- 03 Mar 2014 12:19
- Forum: DOS Batch Forum
- Topic: For/if parsing under delayedExpansion vs. general rules
- Replies: 14
- Views: 13874
Re: For/if parsing under delayedExpansion vs. general rules
This doesn't look like a tokenizing issue. The error " 'if' is not recognized as an internal or external command " shows that the primary token is in fact identified correctly, but at a point where it's no longer recognized as the internal "if" command. As for the 'call' part, pr...
- 02 Mar 2014 23:27
- Forum: DOS Batch Forum
- Topic: For/if parsing under delayedExpansion vs. general rules
- Replies: 14
- Views: 13874
For/if parsing under delayedExpansion vs. general rules
For/if commands seem to fail when executed via a delayed expansion, or a 'call'. @echo off & setlocal disableDelayedExpansion echo( set "echo.ok=echo 123" set "if.fail.edx=if 1==1 (echo 1==1) else (echo ???)" set "for.fail.edx=for %%X in (x y) do echo '%%X' @rem all work...
- 01 Mar 2014 18:29
- Forum: DOS Batch Forum
- Topic: For loop syntax quirks
- Replies: 15
- Views: 12459
Re: For loop syntax quirks
Is there a reason why you don't just add doublequotes to e temporary variable v2_2 and work on it using %%v? Basically, you are changing Y to a different Y (as used in the 1st sentence of the OP). That makes it an entirely different question, and one which happens to have an easy answer, as you not...