* dos command
@ 2008-10-05 13:04 idan72
2008-10-05 18:36 ` Frank Cox
0 siblings, 1 reply; 8+ messages in thread
From: idan72 @ 2008-10-05 13:04 UTC (permalink / raw)
To: linux-msdos
Hi,
How can I send in one line two different dos command ?
Thanks
--
View this message in context: http://www.nabble.com/dos-command-tp19824395p19824395.html
Sent from the linux-msdos mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dos command
2008-10-05 13:04 dos command idan72
@ 2008-10-05 18:36 ` Frank Cox
2008-10-05 19:24 ` Idan Shai (ishai)
0 siblings, 1 reply; 8+ messages in thread
From: Frank Cox @ 2008-10-05 18:36 UTC (permalink / raw)
To: idan72; +Cc: linux-msdos
On Sun, 5 Oct 2008 07:53:24 -0700 (PDT)
idan72 <ishai@cisco.com> wrote:
> How can I send in one line two different dos command ?
Do you mean that you want to pipe the output of one command to another? If so,
you just separate the commands with a | character ( which is shift-\ on most
keyboards).
type file.txt | more
That will take the output of the type command and pipe it into the more command.
If you just want to feed commands to the command line one at a time but type
just one thing, then you need to write a batch file, which is just a text file
that contains the commands that you want to run. dosemu comes with a batch
file called autoexec.bat in the c:\ directory -- take a look at that for an
example of how to write one.
--
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
DRY CLEANER BUSINESS FOR SALE ~ http://www.canadadrycleanerforsale.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: dos command
2008-10-05 18:36 ` Frank Cox
@ 2008-10-05 19:24 ` Idan Shai (ishai)
2008-10-05 19:30 ` Frank Cox
0 siblings, 1 reply; 8+ messages in thread
From: Idan Shai (ishai) @ 2008-10-05 19:24 UTC (permalink / raw)
To: Frank Cox; +Cc: linux-msdos
Hi Frank,
I have java program that I want to execute batch from it.
I want to set environment variable before I run the batch file.
For example the 2 commands I want to run are:
1. set val=5
2. a.bat
Sample how it was in Unix:
[ishai@mip-devtest ishai]$ export val=7;a.bat
7
[ishai@mip-devtest ishai]$ cat a.bat
echo $val
[ishai@mip-devtest ishai]$
Thanks
Idan
-----Original Message-----
From: Frank Cox [mailto:theatre@sasktel.net]
Sent: Sunday, October 05, 2008 8:36 PM
To: Idan Shai (ishai)
Cc: linux-msdos@vger.kernel.org
Subject: Re: dos command
On Sun, 5 Oct 2008 07:53:24 -0700 (PDT)
idan72 <ishai@cisco.com> wrote:
> How can I send in one line two different dos command ?
Do you mean that you want to pipe the output of one command to another?
If so, you just separate the commands with a | character ( which is
shift-\ on most keyboards).
type file.txt | more
That will take the output of the type command and pipe it into the more
command.
If you just want to feed commands to the command line one at a time but
type just one thing, then you need to write a batch file, which is just
a text file that contains the commands that you want to run. dosemu
comes with a batch file called autoexec.bat in the c:\ directory -- take
a look at that for an example of how to write one.
--
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com DRY
CLEANER BUSINESS FOR SALE ~ http://www.canadadrycleanerforsale.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dos command
2008-10-05 19:24 ` Idan Shai (ishai)
@ 2008-10-05 19:30 ` Frank Cox
2008-10-05 19:46 ` Idan Shai (ishai)
0 siblings, 1 reply; 8+ messages in thread
From: Frank Cox @ 2008-10-05 19:30 UTC (permalink / raw)
To: Idan Shai (ishai); +Cc: linux-msdos
On Sun, 05 Oct 2008 21:24:06 +0200
"Idan Shai (ishai)" <ishai@cisco.com> wrote:
> I have java program that I want to execute batch from it.
> I want to set environment variable before I run the batch file.
> For example the 2 commands I want to run are:
> 1. set val=5
> 2. a.bat
1) Make the first line of a.bat read "set val=5" (without the quotes)
or
2) Make a second batch file that calls a.bat, as in this example:
set val=5
a
Save that as b.bat and run b.bat when you want to run the program.
--
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
DRY CLEANER BUSINESS FOR SALE ~ http://www.canadadrycleanerforsale.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: dos command
2008-10-05 19:30 ` Frank Cox
@ 2008-10-05 19:46 ` Idan Shai (ishai)
0 siblings, 0 replies; 8+ messages in thread
From: Idan Shai (ishai) @ 2008-10-05 19:46 UTC (permalink / raw)
To: Frank Cox; +Cc: linux-msdos
Hi Frank,
Thanks for your answer.
If I understand your suggestion is to create at runtine the batch file
as I don't know what the value if I will need to set for val.
Isn't a way in dos to run 2 commands or more in same line as in Unix for
example ?
Thanks
Idan
-----Original Message-----
From: Frank Cox [mailto:theatre@sasktel.net]
Sent: Sunday, October 05, 2008 9:31 PM
To: Idan Shai (ishai)
Cc: linux-msdos@vger.kernel.org
Subject: Re: dos command
On Sun, 05 Oct 2008 21:24:06 +0200
"Idan Shai (ishai)" <ishai@cisco.com> wrote:
> I have java program that I want to execute batch from it.
> I want to set environment variable before I run the batch file.
> For example the 2 commands I want to run are:
> 1. set val=5
> 2. a.bat
1) Make the first line of a.bat read "set val=5" (without the quotes)
or
2) Make a second batch file that calls a.bat, as in this example:
set val=5
a
Save that as b.bat and run b.bat when you want to run the program.
--
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com DRY
CLEANER BUSINESS FOR SALE ~ http://www.canadadrycleanerforsale.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: dos command
@ 2008-10-06 10:44 Manfred Scherer
[not found] ` <48EA9EA4.3030603@pobox.com>
0 siblings, 1 reply; 8+ messages in thread
From: Manfred Scherer @ 2008-10-06 10:44 UTC (permalink / raw)
To: linux-msdos
there is no way to run more than one command in the dos commandline,
except command piping.
A possibility is to turn over the value as a commandline argument:
The first line in your a.bat should bee:
set val=%1
Call the batchfile a.bat with your value (i.e. 7) in one command line:
call a.bat 7
If you cannot modify your a.bat before, then you can generate a version of it:
echo set val=%%1 > b.bat
cat a.bat >> b.bat
call b.bat 7
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dos command
[not found] ` <48EA9EA4.3030603@pobox.com>
@ 2008-10-06 23:49 ` Manfred Scherer
2008-10-07 7:47 ` Frank Cox
0 siblings, 1 reply; 8+ messages in thread
From: Manfred Scherer @ 2008-10-06 23:49 UTC (permalink / raw)
To: Alain M.; +Cc: linux-msdos
... sorry, not 'cat' but 'type' is right.
Am Dienstag, 7. Oktober 2008 01:26 schrieben Sie:
>
> Manfred Scherer escreveu:
> >
> > echo set val=%%1 > b.bat
> > cat a.bat >> b.bat
> > call b.bat 7
>
> hum... un dos:
> type a.bat >> b.bat
>
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: dos command
2008-10-06 23:49 ` Manfred Scherer
@ 2008-10-07 7:47 ` Frank Cox
0 siblings, 0 replies; 8+ messages in thread
From: Frank Cox @ 2008-10-07 7:47 UTC (permalink / raw)
To: Manfred Scherer; +Cc: Alain M., linux-msdos
On Tue, 7 Oct 2008 01:49:32 +0200
Manfred Scherer <manfred.scherer.mhm@t-online.de> wrote:
> ... sorry, not 'cat' but 'type' is right.
http://openetwork.com/berk.html
--
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
DRY CLEANER BUSINESS FOR SALE ~ http://www.canadadrycleanerforsale.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-10-07 7:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-05 13:04 dos command idan72
2008-10-05 18:36 ` Frank Cox
2008-10-05 19:24 ` Idan Shai (ishai)
2008-10-05 19:30 ` Frank Cox
2008-10-05 19:46 ` Idan Shai (ishai)
-- strict thread matches above, loose matches on Subject: below --
2008-10-06 10:44 Manfred Scherer
[not found] ` <48EA9EA4.3030603@pobox.com>
2008-10-06 23:49 ` Manfred Scherer
2008-10-07 7:47 ` Frank Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox