Re: [ql-users] c68 question

2002-04-25 Thread Richard Zidlicky

On Tue, Apr 23, 2002 at 11:41:48PM +0100, P Witte wrote:
.
> 
> I think, on the whole, it would be more sensible for programs that expect
> an unknown - possibly vast - quantity of items as in my original example, 
> to be more elegantly written with that in mind..

depends, if 'xargs' is good enough for your problem than it would
be certainly preferable, because it can be resued by other programs
as well without even recompiling anything.

I can even think of a generalised version of xargs which would
arrange the arguments according to a printf-like format string
- finally one point where QDOS would be more unixish than unix
itself :)

Richard




RE: [ql-users] c68 question

2002-04-24 Thread Ian . Pine

Ooops, I think I kind of lost the plot with that last reply.  You were telling me that 
there is a version of xargs for SMSQ/E and I started wittering on about not having a 
spare partition for Linux!  duh!   It's been a long day, I'm getting ready to go 
home...   :o)

Ian.

>-Original Message-
>From: Pine, Ian 
>Sent: 24 April 2002 17:19
>To: [EMAIL PROTECTED]
>Subject: RE: [ql-users] c68 question
>
>
>Richard,
>
>Seeing your example has reminded me that I did use xargs 
>sometime back in the last century when I was working with Unix 
>regularly/exclusively.  Alas, I don't have a large disk in the 
>Q40 at the moment, and the smaller one in there now is fully 
>partitioned for SMSQ/E.  I do have a box running FreeBSD so I 
>can play with xargs on there next chance I get.
>
>For the Q40 I need a bigger box, an additional IDE card for a 
>second disk and CDROM, and for scientists to figure out how to 
>slow down the Earth's spin to 32 hours, then I'll be able to 
>get Linux back on it again.  ;O)
>
>Thanks for offering to send the xargs manpage - if I can't 
>find it at home I'll take you up on that.
>
>cheers,
>Ian.
>
>>-Original Message-
>>From: Richard Zidlicky
>>[mailto:[EMAIL PROTECTED]]
>>Sent: 24 April 2002 13:09
>>To: [EMAIL PROTECTED]
>>Subject: Re: [ql-users] c68 question
>>
>>
>>On Tue, Apr 23, 2002 at 11:12:11AM +0100, [EMAIL PROTECTED] wrote:
>>
>>> >Most of this can be done with xargs as well ...
>>> I haven't looked at xargs yet, in fact I've played with Unix 
>>very little since I've had the Q40.  I must try to find the 
>>time to install it on a spare PC here at work - won't be 
>>allowed to connect it to the network unfortunately.
>>
>>You can also install it on a spare partition of the Q40 at home.
>>
>>xargs is sort of a cut down full command substitution, small example:
>>
>>  find . -name '*.c' -print | xargs 
>>is equivalent to
>>  grep '#include' `find . -name '*.c' -print `
>>
>>and will find all includes used in all .c files in or below current
>>directory. You can of course do
>>  xargs command arg1 ... >
>>to read the arguments from a file instead of a pipe. It is a separate 
>>program so it would work with c68 and all sorts of other programs but
>>it may cause rather largish stack-space allocated to pass the args if 
>>the arg-file or pipe is really big.
>>I can email you the manpage of xargs privately.
>>
>>Richard
>>
>>
>
>Visit our website at http://www.ubswarburg.com
>
>This message contains confidential information and is intended only 
>for the individual named.  If you are not the named addressee you 
>should not disseminate, distribute or copy this e-mail.  Please 
>notify the sender immediately by e-mail if you have received this 
>e-mail by mistake and delete this e-mail from your system.
>
>E-mail transmission cannot be guaranteed to be secure or error-free 
>as information could be intercepted, corrupted, lost, destroyed, 
>arrive late or incomplete, or contain viruses.  The sender therefore 
>does not accept liability for any errors or omissions in the contents 
>of this message which arise as a result of e-mail transmission.  If 
>verification is required please request a hard-copy version.  This 
>message is provided for informational purposes and should not be 
>construed as a solicitation or offer to buy or sell any securities or 
>related financial instruments.
>
>

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.




RE: [ql-users] c68 question

2002-04-24 Thread Ian . Pine

Richard,

Seeing your example has reminded me that I did use xargs sometime back in the last 
century when I was working with Unix regularly/exclusively.  Alas, I don't have a 
large disk in the Q40 at the moment, and the smaller one in there now is fully 
partitioned for SMSQ/E.  I do have a box running FreeBSD so I can play with xargs on 
there next chance I get.

For the Q40 I need a bigger box, an additional IDE card for a second disk and CDROM, 
and for scientists to figure out how to slow down the Earth's spin to 32 hours, then 
I'll be able to get Linux back on it again.  ;O)

Thanks for offering to send the xargs manpage - if I can't find it at home I'll take 
you up on that.

cheers,
Ian.

>-Original Message-
>From: Richard Zidlicky
>[mailto:[EMAIL PROTECTED]]
>Sent: 24 April 2002 13:09
>To: [EMAIL PROTECTED]
>Subject: Re: [ql-users] c68 question
>
>
>On Tue, Apr 23, 2002 at 11:12:11AM +0100, [EMAIL PROTECTED] wrote:
>
>> >Most of this can be done with xargs as well ...
>> I haven't looked at xargs yet, in fact I've played with Unix 
>very little since I've had the Q40.  I must try to find the 
>time to install it on a spare PC here at work - won't be 
>allowed to connect it to the network unfortunately.
>
>You can also install it on a spare partition of the Q40 at home.
>
>xargs is sort of a cut down full command substitution, small example:
>
>  find . -name '*.c' -print | xargs 
>is equivalent to
>  grep '#include' `find . -name '*.c' -print `
>
>and will find all includes used in all .c files in or below current
>directory. You can of course do
>  xargs command arg1 ... 
>to read the arguments from a file instead of a pipe. It is a separate 
>program so it would work with c68 and all sorts of other programs but
>it may cause rather largish stack-space allocated to pass the args if 
>the arg-file or pipe is really big.
>I can email you the manpage of xargs privately.
>
>Richard
>
>

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.




Re: [ql-users] c68 question

2002-04-24 Thread Richard Zidlicky

On Tue, Apr 23, 2002 at 11:12:11AM +0100, [EMAIL PROTECTED] wrote:

> >Most of this can be done with xargs as well ...
> I haven't looked at xargs yet, in fact I've played with Unix very little since I've 
>had the Q40.  I must try to find the time to install it on a spare PC here at work - 
>won't be allowed to connect it to the network unfortunately.

You can also install it on a spare partition of the Q40 at home.

xargs is sort of a cut down full command substitution, small example:

  find . -name '*.c' -print | xargs 
is equivalent to
  grep '#include' `find . -name '*.c' -print `

and will find all includes used in all .c files in or below current
directory. You can of course do
  xargs command arg1 ... 


Re: [ql-users] c68 question

2002-04-23 Thread P Witte

Richard Zidlicky writes:

> > But if all this could be built into the EX command in a future version
of SMSQ/E, then it would be a different matter entirely...
>
> this would not improve much, it would still be only accessible from basic
> and not c68 programs. In SBasic you already have ways to build command
> line strings very flexibly anyway..

It could be written as an extension Thing - accessable for all. Of course,
for SB the 32k string length limit would still have to apply for it to be
transparent to existing code.

I think, on the whole, it would be more sensible for programs that expect
an unknown - possibly vast - quantity of items as in my original example, 
to be more elegantly written with that in mind..


Per








RE: [ql-users] c68 question

2002-04-23 Thread Ian . Pine

>From: Richard Zidlicky

> All Unix shells provide the syntax very nicely using backticks (backquotes?),
> for example
>  mkdir /lib/modules/`uname -r`

Well yes, command substitution is a useful and flexible feature that would be a way to 
do it (and much more besides), but not the same as what was originally requested - 
simply to have the contents of a file substituted onto the command line.  But I agree, 
there would be no need to have a special syntax to do just that if we had fullblown 
command substitution.

>>But if all this could be built into the EX command in a 
>>future version of SMSQ/E, then it would be a different matter 
>>entirely...
>this would not improve much, it would still be only accessible 
>from basic and not c68 programs. In SBasic you already have ways to
>build command line strings very flexibly anyway..

True, one way in SBASIC would be to build your command line in a ramdisk file and then 
execute it.
In C programs it is quite simple if you set up an array of pointers to character 
strings which you initialize from the file. You can pass the pointer to the array in 
the call to execute the program.  (I haven't written a C program that uses that 
technique for a long time so I can't remember the exact syntax, and I can't look at 
Unix man pages until I get home.) 

>Most of this can be done with xargs as well ...
I haven't looked at xargs yet, in fact I've played with Unix very little since I've 
had the Q40.  I must try to find the time to install it on a spare PC here at work - 
won't be allowed to connect it to the network unfortunately.

Ian.

>-Original Message-
>From: Richard Zidlicky
>[mailto:[EMAIL PROTECTED]]
>Sent: 22 April 2002 19:48
>To: [EMAIL PROTECTED]
>Subject: Re: [ql-users] c68 question
>
>
>On Mon, Apr 22, 2002 at 09:38:35AM +0100, [EMAIL PROTECTED] wrote:
>> I've not encountered any Unix shells that offer such a 
>syntax, or any way of doing it from a program.  I believe the 
>cpio and tar Unix utilities support file-lists as an 
>alternative to specifying the individual filenames on the 
>command line, because the length of command line could easily 
>become very long; but this is implemented by their own code, 
>not the command line parser.
>
>All Unix shells provide the syntax very nicely using backticks 
>(backquotes?),
>for example
>  mkdir /lib/modules/`uname -r`
>
>Most of this can be done with xargs as well so I would think 
>the benefit
>of implementing this feature would not outweigh the 
>disadvantages, mainly
>code size and complexity.
>Also, xargs is a separate program so it works in any shell or 
>SBasic once 
>it has been implemented.
>
>> But if all this could be built into the EX command in a 
>future version of SMSQ/E, then it would be a different matter 
>entirely...
>
>this would not improve much, it would still be only accessible 
>from basic
>and not c68 programs. In SBasic you already have ways to build command
>line strings very flexibly anyway..
>
>Richard
>

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.




Re: [ql-users] c68 question

2002-04-22 Thread Richard Zidlicky

On Mon, Apr 22, 2002 at 09:38:35AM +0100, [EMAIL PROTECTED] wrote:
> I've not encountered any Unix shells that offer such a syntax, or any way of doing 
>it from a program.  I believe the cpio and tar Unix utilities support file-lists as 
>an alternative to specifying the individual filenames on the command line, because 
>the length of command line could easily become very long; but this is implemented by 
>their own code, not the command line parser.

All Unix shells provide the syntax very nicely using backticks (backquotes?),
for example
  mkdir /lib/modules/`uname -r`

Most of this can be done with xargs as well so I would think the benefit
of implementing this feature would not outweigh the disadvantages, mainly
code size and complexity.
Also, xargs is a separate program so it works in any shell or SBasic once 
it has been implemented.

> But if all this could be built into the EX command in a future version of SMSQ/E, 
>then it would be a different matter entirely...

this would not improve much, it would still be only accessible from basic
and not c68 programs. In SBasic you already have ways to build command
line strings very flexibly anyway..

Richard



Re: [ql-users] c68 question

2002-04-22 Thread Dave Walker

Ian,

I was thinking of adding support for somethng like "<@ filename" in the
command line as mean simply ready the contents of the file as if it were
part of the command line at the point in question and substititute the
contents in place of the "<@ filename" construct.   Then parse the resulting
command line (now much longer) as if it were the original command line
(therefore all syntax issues are automatically resolved).  I think would
only add about 50-100 bytes to the start-up code so that might not be an
intolerable over-head.   It could also be vectored so that the support could
easily be omitted or included as required.   I would have to decide if the
default was to include or omit the support - although my inclination would
be to include it by default so most programs got the facility.

Dave

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 9:38 AM
Subject: RE: [ql-users] c68 question


> I've not encountered any Unix shells that offer such a syntax, or any way
of doing it from a program.  I believe the cpio and tar Unix utilities
support file-lists as an alternative to specifying the individual filenames
on the command line, because the length of command line could easily become
very long; but this is implemented by their own code, not the command line
parser.
>
> To implement such a feature, you'd need to agree not only the new command
line syntax, but also a standard for the format of an argument list file,
i.e comma/space/tab/semicolon separated list or each line = one arg with
white space literal?  Ideally environment variable substitution should be
handled in the file just like on the command line. The startup code could
become very large, disproportionately so if tacked onto trivial programs,
and wasteful of disk space when included with every program even if they
don't need the feature.
> But if all this could be built into the EX command in a future version of
SMSQ/E, then it would be a different matter entirely...
> Just my two pen'orth.  :)
>
> Ian.
>
> >-Original Message-
> >From: Dave Walker [mailto:[EMAIL PROTECTED]]
> >Sent: 21 April 2002 11:09
> >To: [EMAIL PROTECTED]
> >Subject: Re: [ql-users] c68 question
> >
> >
> >There is no standard way to get a file re-directed to be treated as a
> >command line in c68.
> >
> >You can do file level re-direction and then process the input
> >as though it
> >comes from "stdin".  The standard c68 start-up code will
> >handle attaching
> >the input as stdin, but the processing of this input so that
> >it can be an
> >alternative to the command line has to be implemented within
> >the program
> >itself and is not a standard feature of the c68 start-up code.
> >
> >The main reason that this is not done is simply because there
> >is no agreed
> >syntax that specifies the parameters for a command line are
> >coming from a
> >file.  It would be relatively trivial to enhance the C68
> >start-up code to
> >implement such a feature given an agreement on the syntax for
> >recognising
> >the command line re-direction to a file for parameters.   The
> >idea sounds
> >like a good one, so if anyone has suggestions on a proposed syntax I am
> >happy to consider them for inclusion into the standard c68
> >build.  Is there
> >any standard for this in the Posix/Unix world as I have not
> >come across such
> >a feature?  What about other OS?
> >
> >Dave
> >
> >- Original Message -
> >From: "P Witte" <[EMAIL PROTECTED]>
> >To: "ql users mailing list" <[EMAIL PROTECTED]>
> >Sent: Saturday, April 20, 2002 10:28 PM
> >Subject: [ql-users] c68 question
> >
> >
> >> Is there a way to get a c68 program to accept a commandline
> >> (or part of a command line) from a file/pipe.
> >>
> >> I want to achieve something like:
> >>
> >> EX cprog ; "-options parameters  >>
> >> rather than
> >>
> >> EX cprog ; "-options parameters file1 file2 .. fileN"
> >>
> >> Or is all this entirely up to cprog?
> >>
> >> Per
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
> Visit our website at http://www.ubswarburg.com
>
> This message contains confidential information and is intended only
> for the individual named.  If you are not the named addressee you
> should not disseminate, distribute or copy this e-mail.  Please
> notify the sender immediately by e-mail if you have received this
> e-mail by 

RE: [ql-users] c68 question

2002-04-22 Thread Ian . Pine

I've not encountered any Unix shells that offer such a syntax, or any way of doing it 
from a program.  I believe the cpio and tar Unix utilities support file-lists as an 
alternative to specifying the individual filenames on the command line, because the 
length of command line could easily become very long; but this is implemented by their 
own code, not the command line parser.

To implement such a feature, you'd need to agree not only the new command line syntax, 
but also a standard for the format of an argument list file, i.e 
comma/space/tab/semicolon separated list or each line = one arg with white space 
literal?  Ideally environment variable substitution should be handled in the file just 
like on the command line. The startup code could become very large, disproportionately 
so if tacked onto trivial programs, and wasteful of disk space when included with 
every program even if they don't need the feature.
But if all this could be built into the EX command in a future version of SMSQ/E, then 
it would be a different matter entirely...
Just my two pen'orth.  :)

Ian.

>-Original Message-
>From: Dave Walker [mailto:[EMAIL PROTECTED]]
>Sent: 21 April 2002 11:09
>To: [EMAIL PROTECTED]
>Subject: Re: [ql-users] c68 question
>
>
>There is no standard way to get a file re-directed to be treated as a
>command line in c68.
>
>You can do file level re-direction and then process the input 
>as though it
>comes from "stdin".  The standard c68 start-up code will 
>handle attaching
>the input as stdin, but the processing of this input so that 
>it can be an
>alternative to the command line has to be implemented within 
>the program
>itself and is not a standard feature of the c68 start-up code.
>
>The main reason that this is not done is simply because there 
>is no agreed
>syntax that specifies the parameters for a command line are 
>coming from a
>file.  It would be relatively trivial to enhance the C68 
>start-up code to
>implement such a feature given an agreement on the syntax for 
>recognising
>the command line re-direction to a file for parameters.   The 
>idea sounds
>like a good one, so if anyone has suggestions on a proposed syntax I am
>happy to consider them for inclusion into the standard c68 
>build.  Is there
>any standard for this in the Posix/Unix world as I have not 
>come across such
>a feature?  What about other OS?
>
>Dave
>
>- Original Message -----
>From: "P Witte" <[EMAIL PROTECTED]>
>To: "ql users mailing list" <[EMAIL PROTECTED]>
>Sent: Saturday, April 20, 2002 10:28 PM
>Subject: [ql-users] c68 question
>
>
>> Is there a way to get a c68 program to accept a commandline
>> (or part of a command line) from a file/pipe.
>>
>> I want to achieve something like:
>>
>> EX cprog ; "-options parameters >
>> rather than
>>
>> EX cprog ; "-options parameters file1 file2 .. fileN"
>>
>> Or is all this entirely up to cprog?
>>
>> Per
>>
>>
>>
>>
>>
>>
>
>

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.




Re: [ql-users] c68 question

2002-04-21 Thread Richard Zidlicky

On Sun, Apr 21, 2002 at 11:08:33AM +0100, Dave Walker wrote:
> There is no standard way to get a file re-directed to be treated as a
> command line in c68.
> 
> You can do file level re-direction and then process the input as though it
> comes from "stdin".  The standard c68 start-up code will handle attaching
> the input as stdin, but the processing of this input so that it can be an
> alternative to the command line has to be implemented within the program
> itself and is not a standard feature of the c68 start-up code.
> 
> The main reason that this is not done is simply because there is no agreed
> syntax that specifies the parameters for a command line are coming from a
> file.  It would be relatively trivial to enhance the C68 start-up code to
> implement such a feature given an agreement on the syntax for recognising
> the command line re-direction to a file for parameters.   The idea sounds
> like a good one, so if anyone has suggestions on a proposed syntax I am
> happy to consider them for inclusion into the standard c68 build.  Is there
> any standard for this in the Posix/Unix world as I have not come across such
> a feature?  

that sounds much like a 'xargs' job, xargs is part of recent findutils
so maybe it has already been ported? In any case it should be rather
trivial to port - except that we may get problems with very big 
commandlines than.

Richard



Re: [ql-users] c68 question

2002-04-21 Thread P Witte


Dave Walker writes:

> There is no standard way to get a file re-directed to be treated as a
> command line in c68.

Thank you. That explains why I cant do what I was trying to do. Ill have to
find another way.

<>
> The main reason that this is not done is simply because there is no agreed
> syntax that specifies the parameters for a command line are coming from a
> file.  It would be relatively trivial to enhance the C68 start-up code to
> implement such a feature given an agreement on the syntax for recognising
> the command line re-direction to a file for parameters.   The idea sounds
> like a good one, so if anyone has suggestions on a proposed syntax I am
> happy to consider them for inclusion into the standard c68 build.  Is
there
> any standard for this in the Posix/Unix world as I have not come across
such
> a feature?  What about other OS?

EX cprog, #stdin, #stdout; 'stdout 2>stderr 3


Re: [ql-users] c68 question

2002-04-21 Thread Dave Walker

There is no standard way to get a file re-directed to be treated as a
command line in c68.

You can do file level re-direction and then process the input as though it
comes from "stdin".  The standard c68 start-up code will handle attaching
the input as stdin, but the processing of this input so that it can be an
alternative to the command line has to be implemented within the program
itself and is not a standard feature of the c68 start-up code.

The main reason that this is not done is simply because there is no agreed
syntax that specifies the parameters for a command line are coming from a
file.  It would be relatively trivial to enhance the C68 start-up code to
implement such a feature given an agreement on the syntax for recognising
the command line re-direction to a file for parameters.   The idea sounds
like a good one, so if anyone has suggestions on a proposed syntax I am
happy to consider them for inclusion into the standard c68 build.  Is there
any standard for this in the Posix/Unix world as I have not come across such
a feature?  What about other OS?

Dave

- Original Message -
From: "P Witte" <[EMAIL PROTECTED]>
To: "ql users mailing list" <[EMAIL PROTECTED]>
Sent: Saturday, April 20, 2002 10:28 PM
Subject: [ql-users] c68 question


> Is there a way to get a c68 program to accept a commandline
> (or part of a command line) from a file/pipe.
>
> I want to achieve something like:
>
> EX cprog ; "-options parameters 
> rather than
>
> EX cprog ; "-options parameters file1 file2 .. fileN"
>
> Or is all this entirely up to cprog?
>
> Per
>
>
>
>
>
>




Re: [ql-users] c68 question

2002-04-20 Thread Timothy Swenson

At 12:50 AM 4/21/2002 +0100, you wrote:

>But is the command line the same as stdin? I tried the syntax in (1) above
>and also:

The command line is not STDIN.   With C (and Perl) the command line is 
normally stored in a variable (ARGV tells how many arguements).  ARGV[0] is 
the program that was executed, ARGV[1] is the first argument, etc. (ARGV is 
close the the real answer.  Check a C manual for the exact variable 
name.  I'm going by memory here).

> 3 EX cprog, file_list, #1; "-options parameters "

I believe you are doing channel redirection (again going from memory).  I 
have not tried this with C68 and found a problem with it in Qliberator (a 
bug caused it not to work).  The Qlib docs talk about how this works.  I 
don't know if TKII docs or SMSQ/E docs talk about channel redirection or 
not.  I don't think it's used all that often.


> 4 EX cprog, file_list, #1; "-options parameters -f file_list"
>
>returns "cannot open -f file_list" - ie it thinks -f file_list is one of the
>list of files.. -f as one of the options makes the program take 
>to be the file_list filename! Ie it will happily except a list of parameters
>from the file, but not a list of files.

The program has to be written so that it thinks that '-f file_list' is a 
proper option and knows how to deal with it (in other words, you need to 
fill in this part to make it work).  Without it knowing the '-f' option 
then of course it will assume it's a file name.  Besides, I suggested a 
'-f' option as an example, you can name the option what ever you want.

I'm assuming you are dealing with code that you are writing.

Tim Swenson




Re: [ql-users] c68 question

2002-04-20 Thread P Witte

Timothy Swenson writes:

> >Is there a way to get a c68 program to accept a commandline
> >(or part of a command line) from a file/pipe.
> >
> >I want to achieve something like:
> >   1  EX cprog ; "-options parameters  >rather than
> >2 EX cprog ; "-options parameters file1 file2 .. fileN"
> >Or is all this entirely up to cprog?
>
> I'm pretty sure C68 supports file redirection.  Since the filelist_file
> would be coming in on STDIN and not as an argument list, it is up to the
> program to process it correctly.  With some programming skill, you could
> get the program to accept data either way.  Using an option like "-f
> filelist_file" would work.  This would have the user tell the program to
> use a file list file (and not list any files in the command line.
>
> If a program will work in Unix, then it should work in C68.  It's very
Unix
> like in how it handles itself.

But is the command line the same as stdin? I tried the syntax in (1) above
and also:

3 EX cprog, file_list, #1; "-options parameters "

with file_list containing

file1 file2..fileN

to no avail. (2) works as expected. Both (1) and (3) are recognised by c68
(as if you give a wrong file name you get a "not found" error)

4 EX cprog, file_list, #1; "-options parameters -f file_list"

returns "cannot open -f file_list" - ie it thinks -f file_list is one of the
list of files.. -f as one of the options makes the program take 
to be the file_list filename! Ie it will happily except a list of parameters
from the file, but not a list of files.

Any further ideas?

Per




Re: [ql-users] c68 question

2002-04-20 Thread P Witte

Peter S Tillier writes:

> > Is there a way to get a c68 program to accept a commandline
> > (or part of a command line) from a file/pipe.
> >
> > I want to achieve something like:
> >
> > EX cprog ; "-options parameters  >
> > rather than
> >
> > EX cprog ; "-options parameters file1 file2 .. fileN"
> >
> > Or is all this entirely up to cprog?
> >
> > Per
> >
>
> Per,
>
> You can always do this using the shell - see Phoebus' message a few
threads earlier.  I always use the shell for redirections, the SuperBasic
syntax is just too much for me tocope with (although it can be done I
believe).

Perhaps I should have mentioned: I want to call cprog from within another
program, so Shell is not an option. Thanks anyway.

Per




Re: [ql-users] c68 question

2002-04-20 Thread Timothy Swenson

At 10:28 PM 4/20/2002 +0100, you wrote:
>Is there a way to get a c68 program to accept a commandline
>(or part of a command line) from a file/pipe.
>
>I want to achieve something like:
> EX cprog ; "-options parameters rather than
> EX cprog ; "-options parameters file1 file2 .. fileN"
>Or is all this entirely up to cprog?

I'm pretty sure C68 supports file redirection.  Since the filelist_file 
would be coming in on STDIN and not as an argument list, it is up to the 
program to process it correctly.  With some programming skill, you could 
get the program to accept data either way.  Using an option like "-f 
filelist_file" would work.  This would have the user tell the program to 
use a file list file (and not list any files in the command line.

If a program will work in Unix, then it should work in C68.  It's very Unix 
like in how it handles itself.

Tim Swenson




Re: [ql-users] c68 question

2002-04-20 Thread peter . tillier

- Original Message - 
From: "P Witte" <[EMAIL PROTECTED]>
To: "ql users mailing list" <[EMAIL PROTECTED]>
Sent: Saturday, April 20, 2002 10:28 PM
Subject: [ql-users] c68 question


> Is there a way to get a c68 program to accept a commandline 
> (or part of a command line) from a file/pipe.
> 
> I want to achieve something like:
> 
> EX cprog ; "-options parameters  
> rather than
> 
> EX cprog ; "-options parameters file1 file2 .. fileN"
> 
> Or is all this entirely up to cprog?
> 
> Per
> 

Per,

You can always do this using the shell - see Phoebus' message a few threads earlier.  
I always use the shell for redirections, the SuperBasic syntax is just too much for me 
tocope with (although it can be done I believe).

Peter
-- 
Peter S Tillier[EMAIL PROTECTED]
   [EMAIL PROTECTED]
Opinions expressed are my own and not necessarily
those of my employer.



[ql-users] c68 question

2002-04-20 Thread P Witte

Is there a way to get a c68 program to accept a commandline 
(or part of a command line) from a file/pipe.

I want to achieve something like:

EX cprog ; "-options parameters