Search found 122 matches

by jfl
10 Nov 2016 05:35
Forum: DOS Batch Forum
Topic: Converting Several Lines to One Line with Punctuation
Replies: 10
Views: 2386

Re: Converting Several Lines to One Line with Punctuation

I could not get the first two SET /P commands to work with NUL redirection. They do work if the NUL redirection is placed ahead of the line, instead of at the end as you did. (But I don't know why either!) Then the code can be slightly simplified by factoring out all the <nul redirections like this...
by jfl
21 Oct 2016 02:20
Forum: DOS Batch Forum
Topic: RdRand.exe: Robust random numbers for Batch files
Replies: 19
Views: 6657

Re: RdRand.exe: Robust random numbers for Batch files

The code looks much better indeed with the proto directive, allowing to remove the ugly @4 decorations I had to add. Thanks. As for the includlib directive, you should append the \masm32\lib pathname your LIB environment variable, and remove the absolute path in your source. includelib kernel32.lib ...
by jfl
20 Oct 2016 14:05
Forum: DOS Batch Forum
Topic: RdRand.exe: Robust random numbers for Batch files
Replies: 19
Views: 6657

Re: RdRand.exe: Robust random numbers for Batch files

This works for me on my laptop, thanks. I had to make the following changes, so that the code builds with the ML.EXE assembler shipped with Visual Studio 2013: ;RdRand.asm: Return a random number generated by RDRAND CPU instruction ;https://software.intel.com/en-us/articles/intel-digital-random-numb...
by jfl
20 Oct 2016 01:28
Forum: DOS Batch Forum
Topic: We can use bash in our scripts now in Win10
Replies: 20
Views: 8172

Re: We can use bash in our scripts now in Win10

You can run any linux program within it? Any text-mode program. GUI programs are not yet supported, and I don't know if they ever will. By default, they install just the bare minimum set of shell tools that Posix requires. Then you can use the apt-get package manager to get the rest from Ubuntu rep...
by jfl
19 Oct 2016 14:57
Forum: DOS Batch Forum
Topic: We can use bash in our scripts now in Win10
Replies: 20
Views: 8172

Re: We can use bash in our scripts now in Win10

Why would they not account for this in the version of BASH they are using on Windows. Because Microsoft just provides the Linux-compatible kernel. Everything else is just plain unmodified Ubuntu applications, including bash. This is the beauty of it: You can install any Ubuntu package, and be sure ...
by jfl
19 Oct 2016 10:42
Forum: DOS Batch Forum
Topic: We can use bash in our scripts now in Win10
Replies: 20
Views: 8172

Re: We can use bash in our scripts now in Win10

The above examples do not work for me, in Windows 10 build 14393. There are two problems: ⋅  Ubuntu bash does not find the windows pathname of the script, as its drive letter and \ separators mean nothing to it. Resolved by converting the Windows name to the Linux name. ⋅  Also t...
by jfl
17 Dec 2015 11:47
Forum: DOS Batch Forum
Topic: Any batch parser written in batch ?
Replies: 2
Views: 1219

Re: Any batch parser written in batch ?

I'd like this parser to be in batch because the rest of my batch debugging library (Making batch scripts self-debugging) is in batch also, and I'd like to keep it that way, without any external dependencies. And a parser like this may have been done for other reasons than debugging. The %CALL% macro...
by jfl
17 Dec 2015 04:54
Forum: DOS Batch Forum
Topic: Any batch parser written in batch ?
Replies: 2
Views: 1219

Any batch parser written in batch ?

Hi, to resolve some limitations of my batch debugging library , I'm afraid I'll need a batch parser written in batch. Use cases: ⋅ Output a set command, that can copied and run to recreate any variable value. Currently my :EchoVars routine works well for "normal" values, but does...
by jfl
10 Dec 2015 10:56
Forum: DOS Batch Forum
Topic: CALL me, or better avoid call
Replies: 21
Views: 16269

Re: CALL me, or better avoid call

About trying to emulate calls with gotos, I just found this funny trick using a %call% macro using only gotos: @echo off setlocal EnableExtensions EnableDelayedExpansion set "^!=^^^^^^^!" &:# Define a %!%DelayedExpansion%!% variable set "call= <nul>nul verify & for %%$ in (1 2...
by jfl
30 Nov 2015 09:30
Forum: DOS Batch Forum
Topic: exit function and preserve variable over endlocal barrier
Replies: 23
Views: 12031

Re: exit function and preserve variable over endlocal barrier

FYI I've posted in http://www.dostips.com/forum/viewtopic.php?f=3&t=6796&p=44199#p44199 a %RETURN% macro, partly inspired by your return.bat, that allows returning any number of variables back to the caller's variable scope. The previous posts in that thread explain the associated %FUNCTION%...
by jfl
30 Nov 2015 09:20
Forum: DOS Batch Forum
Topic: A batch file debugging library
Replies: 5
Views: 3170

Re: A batch file debugging library

I understood at last why my delayed redirection code did not work: This is a well known limitation (at least to old timers on this forum) of the cmd parser, and I was trying to do the impossible. As explained in http://www.dostips.com/forum/viewtopic.php?f=3&t=6587#p42330 , in a call command, re...
by jfl
29 Nov 2015 09:31
Forum: DOS Batch Forum
Topic: [Win10] Move and rename a file
Replies: 3
Views: 1358

Re: [Win10] Move and rename a file

The move command works in Windows 10 exactly like it did in Windows 7 or 8.

An no, as far as I know, there's no Windows 10.1 yet. A new build is available, that would have been called a Service Pack in the past, but it's still Windows 10.0.

Jean-François
by jfl
28 Nov 2015 11:17
Forum: DOS Batch Forum
Topic: A batch file debugging library
Replies: 5
Views: 3170

Re: A batch file debugging library

It is strange how posting something on a forum makes you think harder about it! I finally followed your advice, and rewrote my macros to avoid calling subroutines. But this proved more difficult than I thought, and there are still corner cases where I did not manage to avoid it. More on this later. ...
by jfl
17 Nov 2015 11:58
Forum: DOS Batch Forum
Topic: A batch file debugging library
Replies: 5
Views: 3170

Re: A batch file debugging library

Macro's have a dramatically and linearly negative effect on the performance of setlocal etc.. Performance is excellent in all my scripts, with no noticeable slowdown in non-debug mode. (I'm not doing math, I'm doing system configuration. So the script is rarely the performance limitation, it's the ...
by jfl
16 Nov 2015 17:53
Forum: DOS Batch Forum
Topic: A batch file debugging library
Replies: 5
Views: 3170

A batch file debugging library

Hello, I've been silently following this mailing list for quite some time, and I'd like to thank all participants for the great things I learned here. Now it's time to contribute something back: First and foremost, I'd like to contribute my batch debugging library. This library has allowed me to suc...