dukeofgaming
dukeofgaming

Reputation: 3198

How can I execute command line output in windows without having to generate a bat file?

I did a little script to pull the latest of all my subrepos in Mercurial (without updating them) for a very particular experiment (integrating with another VCS whose repo I had to break in different subrepos) that requires all subrepos in sync.

For this, a first step is the following command:

cat .hgsubstate|sed -r s:^\w+\s(.*):\1:g|sed -r s:(.*):'hg pull -R \1 perforce':g

That gives me as output all the commands I have to execute line by line, however I'm in windows and there is no eval to pipe them to (I have cygwin):

hg pull -R apps/canservice perforce
hg pull -R apps/hmi perforce
hg pull -R apps/lua perforce

I don't want to have to generate a bat file, execute it and then delete it, so, is there any alternative for doing this in a single blow?

Upvotes: 1

Views: 188

Answers (1)

Zombo
Zombo

Reputation: 1

This has worked for me in the past

foo | bar | cmd.exe

Upvotes: 1

Related Questions