commandfileb.cmd wants the contents of filea.txt as a parameter, like to use
it as %1 in commandfileb.cmd. I thought I tried the commandfileb.cmd <
filea.txt technique and it didn't work...I was using the echo command in
commandfileb.cmd just to see the contents...I wonder if that makes a
difference.


On Wed, Mar 4, 2009 at 2:10 PM, Douglas Handy <dhandy@xxxxxxxxx> wrote:

Michael

What I want to do is this in a command file:

type filea.txt | commandfileb.cmd

And then commandfileb.cmd needs to do something with the content of
filea.txt.

Anyone know how to do this in a DOS command file? commandfileb.cmd
doesn't
seem to get the passed parameter...


As written, commandfileb.cmd isn't being passed a parameter -- it is
getting
the contents of filea.txt "piped" to it via stdin so commandfileb.cmd would
need to expect to read the data via stdin and not from a filename passed as
an argument.

Since the "type" command just echoes the contents of the file, it is the
same thing as doing this:

commandfileb.cmd < filea.txt

which redirects stdin for commandfileb.cmd to instead come from the
contents
of filea.txt

If commandfileb.cmd is expecting to read the file instead of stdin, then
perhaps you just want:

commandfileb.cmd filea.txt

But it isn't clear what commandfileb.cmd expects. You say it doesn't get a
passed parameter, but you are piping data to it via stdin and not passing a
parameter. So can you clarify what commandfileb.cmd expects?
--
This is the PC Technical Discussion for iSeries Users (PcTech) mailing list
To post a message email: PcTech@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/pctech
or email: PcTech-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/pctech.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.