简体   繁体   中英

What is the Windows equivalent of `{} +` in Linux Shell?

I'm trying to make a simple batch file to compile some code and I can't for the life of me figure out or find any information on how to do this.

On Linux, I'm doing this:

find ./bin-int/ -type f -name '*.o' -exec rgblink -o ./bin/lapis.gb -n ./bin-int/symbols.sym {} +

This basically finds all the files in./bin-int/ with the extension.o, and use them as the input variable for the command rgblink.

But I can't for the life of me figure out how to do this on Windows. The closest I got is

for /r ".\bin-int" %%i in (*.o); do rgblink -o ./bin/lapis.gb  -n ./bin-int/symbols.sym %%i

which is wrong because I don't want to run the command once for EACH file. I want the EVERY file to be the input for the command, at the same time.

How can I do this? Thanks!

You'll need to append the list to a variable first, then run the list in the command:

@for /r ".\bin-int" %%i in (*.o) do @call set "list=%%list%% %%i"
rgblink -o ./bin-int/lapis.gb  -n ./bin-int/symbols.sym%list%

this is untested as I cannot confirm what your list should look like exactly, but you'll get the idea.

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