The 4DOS command processor for MS-DOS

4dos, batch commands, grub 4 dos, dos 4, ms dos 4

do v in 1 2 3

Hello All!

FOR loop allows the following construct:

 for %v in (1 2 3) echo %v

will display

1
2
3

Although DO man pages state that ‘DO v IN set’ is similar to ‘FOR %v IN set’,
 do v in 1 2 3
  echo %v
 enddo

doesn’t work and displays ‘there are no more files: "1 2 3" message which is
bad by itself, but trying to kludge around this feature I’ve discovered even a
more unexpected thing: I’ve tried to run

 do v in 1;2;3
  echo %v
 enddo

And found out that

1. %v is assigned only values of actually existing files or directories, i.e.
if files ’1′ and ’3′ exist, it will display

1
3

Ok, it still may be called a ‘feature’.

2. If the first file (i.e. ’1′) does not exist, it will display an error
message about not being able to locate the first file anyway.

Of course I want DO work exactly as FOR – i.e.

 do v in 1 2 3
  echo %v
 enddo

must display 1 2 3 regardless of what files actually exist.

4OS2 3.01A   OS/2 Version is 3.00
4OS2 Revision A (119)   OS/2 Revision A

:), Leo

— lvm#aha.ru
 * Origin: – The Endless Quest – (2:5020/293)

Comments (3)

JP Sofwtare Support Forum

A reminder that if you have Technical Support questions or
concerns about any JP Software products, you should strongly
consider joining our Support Forum (accessible as a mailing list,
a news group, or web pages) where we can best help you in a timely
fashion.  See our web site for details.

 ——————————————————
 Mike Bessy                    JP Software, Inc.
 email supp…@jpsoft.com      web http://jpsoft.com/
 ______________________________________________________

No Comments

Help! I need an old version of DOS!

I would like to know if there is an old version of dos, specifically version
3.20, that will run on an NEC (?) V30. Would that version be the same as the
one for, say, and Intel 8086 chip? I need to know where to find v3.20 for a
V30 ASAP for an Epson Laptop. Also, are there any good DOS-based text
editors that can print? Thank you in advance.

Chris russell
chrisrussell2k_at_yahoo.com
please remove the _at_ and replace it with @
thanks again

Comments (2)

unset-ting all but something

  Hiho!

 Wasn’t it a good idea to include a feature of "unset"ing all
environment variables *except* some crucial or specified — as
functionality of the snippet below, that does exactly that (can also be
made an alias)

      — Xenocryst

——- start-of-xunset.btm —–
iff "%1" eq "" .or. %@index[%1,?] ge 0 then
   echo Usage:%=%@name[%_batchname]  evar [ evar [ .. ] ]  %=|  *
excptvar [ excptvar [ .. ] ] %+ echo.
   echo %=tevar%=t%=t– environment variable to remove
   echo %=texcptvar%=t– environment to leave untouched %+ echo.
   echo %=tSecond variant removes all environment variables except
   echo %=tPATH COMSPEC and excptvar’s.
   quit 1
endiff
if "%1" ne "*" ( *unset/q %& %+ quit %_? )
*set | for i in (@con:) do ( %=
         set __n=0  %+  %=
         for j in (PATH COMSPEC %2&) do ( %=
            if "%@word["=",0,%i]" eq "%j" *set __n=%@inc[%__n] %=
         )  %+  %=
         if 0%__n==0  *unset/q %@word["=",0,%i] %=
      ) %+ *unset/q __n
——- end-of-xunset.btm —–

Sent via Deja.com http://www.deja.com/
Before you buy.

No Comments

*nix'ish "Did You Mean?" feature?

  Hiho again!

 Is there someone out there, who knows an implementation  – or has one
made by his own — of a *nix like "did you mean …?" feature (-
proposing a correct command if the one typed is unknown -) perhaps using
the 4DOS int 2Fh interface and/or unknown_cmd alias?

    I appreciate your inconveniences,
          — Xenocryst


Mental illness is the road to freedom

Sent via Deja.com http://www.deja.com/
Before you buy.

No Comments

.ini file

Anyone has a sample .ini file?

Sent via Deja.com http://www.deja.com/
Before you buy.

Comment (1)

Am I blind – why does this alias not work

I wrote the following fairly simple alias:

netstatus=iff ".%1." == ".."  THEN ^ netstat -?  ELSE ^ netstat
%1& ENDIFF

whose purpose is to detect running without parameters and give
help.  It always
executes "netstat -?" twice with no parameters, and never gets to
running netstat with a supplied parameter.

The "^"s are for 4dos only.


     Chuck Falconer (cbfalco…@my-deja.com)
     http://www.qwikpages.com/backstreets/cbfalconer
     (Remove "NOSPAM." from reply address. Above works unmodified)

Comments (5)

There exist TEE and Y commands in abundance

GB> I use command line because it is ofter more powerful. [...]

GB> When I first read about [CreateRemoteThread() it] appeared to be
GB> useful in creating something I’ve wanted since OS/2 was
GB> introduced; a ‘Y’ pipe.  For those who don’t know, a ‘Y’ pipe
GB> sends output to two destinations.  

You’re using the wrong terms.  No wonder you couldn’t find what you
wanted, despite the fact that such utilities have existed and been
widely available (for OS/2 at least) for over a decade.  

What you actually want is a ‘T’, not a ‘Y’.  A ‘T’ sends what it
receives on its standard input to one or more different places,
including its standard output.  A ‘Y’ combines its standard input with
zero or more other files into a single stream which it sends to its
standard output.  Utilities to perform ‘T’ connections usually go by the
name of "TEE".  Had you looked for that name, you would have found them
years ago.  

In the case of OS/2, for example, there are three sets of 32-bit TEE
utilities:  The command interpreters from JP Software, 4OS2 and TCOS2,
have a TEE command built in to them; there are (several) ports of the
GNU (and FreeBSD) "tee" command to OS/2; and there’s a TEE command
written from scratch for OS/2 in the free OS/2 Command Line Utilities.

( There are also 32-bit ‘Y’ utilities for OS/2, going somewhat
unsurprisingly by the name of "Y".  Again, JP Software’s 4OS2 and TCOS2
have Y as a built-in command.  And again, and there’s a Y command
written from scratch for OS/2 in the free OS/2 Command Line Utilities.
The equivalent "Unix-style" utility in this case, albeit with a slightly
different modus operandi, goes by the name of "cat", and there are
several ports of that from GNU and BSD as well. )

If you are looking for Win32 TEE and Y commands, then you have a choice
between three other sets of utilities: the JP Software command
interpreters for Win32 – 4NT and TCWIN32 – have built-in TEE and Y
commands just like 4OS2 and TCOS2 have; the Microsoft Windows NT
Resource Kit provides both Win32 and POSIX flavours of "tee" and "cat"
commands; and there are ports to Win32 of the GNU "tee" and "cat"
utilities, although one has to expend a little effort to hunt them up.
(In the latter two cases one again has the slight difference in how one
uses "cat" to how one uses "Y" to achieve the same end result.)

GB> The problem with any implementation of this under Windows/Dos
GB> is that the pipes are not multiprocessed.   The program runs but
GB> all output is sent to a temp file.  The pipe is then run with all
GB> input coming from the temp file.  The file is then erased.  The
GB> stick is that you have to wait until execution is complete to
GB> see ouput.  

Then don’t use DOS-Windows, where the native command interpreter is a
DOS program that has no knowledge of pipes or multitasking and thus has
to fake the appearance of them using temporary files.  Use OS/2 Warp or
Windows NT, where the native command interpreters are OS/2 and Win32
programs that know all about pipes and multitasking, and that thus run
both sides of a command pipeline in parallel as separate processes,
connecting them through real pipes that are provided by the operating
system.  There are no temporary files, and there is no waiting for the
left-hand side of the pipeline to finish before one starts to see output
from the right-hand side.

The problems that you describe are nothing to do with how one would
implement the TEE and Y commands, and everything to do with the fact
that you are still using a DOS program as your command interpreter.

No Comments

expanded filename matching??

One of the features that I really love about 4DOS/4NT is command-line
completion; type a bit of a file or directory name, hit tab, and the whole
name magically appears….

Unfortunately, that doesn’t appear to work with UNC filenames… I have
frequent need to copy files to \\wizard\derelict-0 , and I’m *really* tired
of typing it all out.  I know I can assign the path to a drive letter, and
in fact up until recently I had done so, but we just installed a new drive
in my machine and all the drive letters changed!!  I’m trying to get myself
OUT of the habit of copying to g:\ (which is now i:\), but typing the path
instead is awkward, for the reason previously stated.

Is there any way to make this work with UNC file/path names???

I’m using 4NT 3.02B on Win NT 4.0 SP 6.

        Dan Miller

Comments (3)

www.msdosweb.com

MS-DOS Lives!!!

Please visit www.msdosweb.com !
With everything about this wonderful operating system:
Prompt
Batch
Games
Utilities
Drivers

Bye
Gijs Leegwater
Webmaster MSDOSWEB.COM

Comment (1)