简体   繁体   中英

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?

过去这对我有用

foo | bar | cmd.exe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM