[comp.sys.atari.st] MT CShell

david.megginson@canremote.uucp (DAVID MEGGINSON) (03/25/90)

I bought MT CShell from David Beckemeyer a few weeks ago. It is, of
course, fantastic. I sent a message to DB after I received it, but he 
did not send an answer, or more likely, he did and it bounced. I've 
answered most of the questions I had by working on my own, but here are 
two which someone may be able to help me with:

1) How do I use the ARGV environment variable? I know it has to be 
   something like xArgs, which I haven't used yet. I want to be able to 
   pass sickeningly long command lines to my own programs too.

2) How do I keep MT CShell from adding quotation marks here:
         set copt=-a -p
         program $copt -i${TCINC} $i
   program gets
         '-a -p' -id:\include myfile.c
   instead of
        -a -p -id:\include myfile.c
   I thought that you could set a variable to a list of words, but 
   MT-CShell is convinced that it has to be one word.

Thanks DB, or anyone else who can help.


David Megginson, Centre for Medieval Studies
meggin@vm.epas.utoronto.ca
---
 * Via ProDoor 3.1R 

david@bdt.UUCP (David Beckemeyer) (03/27/90)

I'm posting this because (1) it's short, and (2) it contains info that
might prevent a posting next time.

In article <90032422335919@masnet.uucp> david.megginson@canremote.uucp (DAVID MEGGINSON) writes:
>1) How do I use the ARGV environment variable? I know it has to be 
>   something like xArgs, which I haven't used yet. I want to be able to 
>   pass sickeningly long command lines to my own programs too.

MT C-Shell uses the Mark Williams ARGV style arguments, which it turns out
is close to the new official Atari "standard" method (in fact it looks like
it's going to be supported for a while because there are so many pgms
using it).   The MWC libraries will automatically understand this extendend
arg format.  The ARGV varaible is the last one in the envrionment.  The
value of ARGV is the wierd MWC "CCCP?????..." string, which they use for
isatty(), but you can ignore it.   After that, the arguments are sitting
in the env., one after another, each separated by a null.

>2) How do I keep MT CShell from adding quotation marks here:
>         set copt=-a -p
>         program $copt -i${TCINC} $i
>   program gets
>         '-a -p' -id:\include myfile.c
>   instead of
>        -a -p -id:\include myfile.c
>   I thought that you could set a variable to a list of words, but 
>   MT-CShell is convinced that it has to be one word.

Yes the variable expands to a single word.  The quotes are only added
in the basepage copy of the args (because there isn't another way to
put whitespace in an argument), but the quotes aren't in the ARGV
list.  One sort of ugly way to get the above to work is to use back-quotes,
as follows:

         set copt=-a -p
         program `echo $copt` -i${TCINC} $i
	
>
>Thanks DB, or anyone else who can help.

No problem.  Please note that you can contact the BDT BBS at (415) 530-9682
for MT C-Shell technical support.  This BBS is also available for anyone
and contains a fair amount of general ST stuff (including comp.sys.atari.st).

>David Megginson, Centre for Medieval Studies
>meggin@vm.epas.utoronto.ca
>---
> * Via ProDoor 3.1R 


-- 
David Beckemeyer (david@bdt.UUCP)	| "I'll forgive you Dad...  If you have
Beckemeyer Development Tools		| a breath mint."
P.O. Box 21575, Oakland, CA 94620	|    Bart - "The Simpsons"
UUCP: {uunet,ucbvax}!unisoft!bdt!david	|