× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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?

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.