TIP: Click on subject to list as thread! ANSI
echo: apple
to: comp.sys.apple2
from: Bill Buckels
date: 2008-08-17 20:28:20
subject: Re: cc65 compile for Apple 2e?

"John B. Matthews"  wrote in message 
news:nospam-6CB84D.20182417082008{at}aioe.org...

> Thanks! Is that the usual DOS idiom for "as many parameters as
are sent?" 
> Would "%1 %2 %3 %4" be OK for up to four?

Yes. And all that a windows user needs to do to find out more is type help 
at the cmd prompt. This convention has been in use for as long as I 
remember. Which isn't saying much since my memory fades fast these days:) 
and since you are not a windows user you'll just have to take my word on it 
 or I'll need to eat more fish.

>Do you know a DOS equivalent to bash "${{at}}", in effect
meaning "all 
>parameters, quoted."

There is NO globbing as such like in bash or ksh or sh or perl that I am 
aware-of... to me batch file syntax is a hybrid like a cross between the old 
CP/M SUBMIT and GWBASIC and other stuff Gates worked on. There is syntax 
like cut uses and the notion of fields and so forth and pipes and 
redirection and all that but the notion of a argument array isn't quite 
there to my knowledge... however a SHIFT keyword does exist ... and 
redirection from a filelist is supported.

Here's a little snippet that provides equivalent output for the first 10 
args, arg0 being the filename similar to what we are all familiar with, and 
there is no such thing as %10 or %11 etc... (you'll note the immediate 
variable %%i is accepted in the set of args, and if you were to run the 
thing it just lists each of the args on a new line in both examples)...

{at}echo off
REM the cmd interpreter has only 10 args available
REM however if the shift command is used it has more

for %%i in (%0 %1 %2 %3 %4 %5 %6 %7 %8 %9) do echo %%i

:BEGIN
if [%0] == [] goto END
echo %0
SHIFT /0
goto BEGIN
:END

Despite its limitations cmd can pretty-much be counted-on to be available to 
all Windows users.

Bill
--- SBBSecho 2.12-Win32
* Origin: Derby City Gateway (1:2320/100.2008)
SEEN-BY: 10/1 3 34/999 106/1 120/228 123/500 140/1 222/2 226/0 236/150 249/303
SEEN-BY: 250/306 261/20 38 100 1404 1406 1410 1418 266/1413 280/1027 320/119
SEEN-BY: 393/11 396/45 633/260 267 712/848 800/432 801/161 189 2222/700
SEEN-BY: 2320/100 105 200 2905/0
@PATH: 2320/100 261/38 633/260 267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.