Converting a Windows BATCH command/script to Linux BASH.
by Skillz from LinuxQuestions.org on (#4WS3H)
So I have some Windows based commands/scripts that make setting up some environments easier for me, but I would like for them to be converted to Linux bash so I can do the same on my Linux boxes as well.
These are the commands I am using.
This command allows me to make multiple directories called BOINC with a number behind the directory that starts at 100, adds +1 to 100 until it gets to 199. So I have 99 directories named BOINC[100 - 199].
FOR /L %X IN (100,1,199) DO mkdir BOINC_%X
This command copies a file (well two files) from a directory called BOINC (no number behind this one) and copies it to all the directories I created in the previous command.
FOR /L %X IN (100,1,199) DO copy BOINC\*.* BOINC_%X\*.*
This command starts a program and associative each one of the directories above as the instances "home directory". So it'll start one instance of BOINC per BOINC(#) above and give each instance a unique RPC port number starting with 50.
FOR /L %X IN (100,1,199) DO start "BOINC_%X" /MIN "c:\Program Files\BOINC\boinc.exe" -allow_multiple_clients -dir c:\Multiboinc\BOINC_%X -gui_rpc_port 50%X
I know the command in Linux, sort of for starting BOINC is this
boinc --daemon --allow_multiple_clients --dir /multiboinc/boinc_%X -gui_rpc_port 50%X
Do note I don't know the linux equivalent for "/boinc_%X" and "50%X" an example command to start one instance would be this
boinc --daemon --allow_multiple_clients --dir /multiboinc/boinc2/ -gui_rpc_port 502
This is for a distribute computing software called BOINC. Some of these projects only send 1 "task" per instance, but my rig is powerful enough to handle 100s of these tasks at once, so I make multiple instances of the BOINC client and run the projects on each instance individually so I can max out the systems resources.


These are the commands I am using.
This command allows me to make multiple directories called BOINC with a number behind the directory that starts at 100, adds +1 to 100 until it gets to 199. So I have 99 directories named BOINC[100 - 199].
FOR /L %X IN (100,1,199) DO mkdir BOINC_%X
This command copies a file (well two files) from a directory called BOINC (no number behind this one) and copies it to all the directories I created in the previous command.
FOR /L %X IN (100,1,199) DO copy BOINC\*.* BOINC_%X\*.*
This command starts a program and associative each one of the directories above as the instances "home directory". So it'll start one instance of BOINC per BOINC(#) above and give each instance a unique RPC port number starting with 50.
FOR /L %X IN (100,1,199) DO start "BOINC_%X" /MIN "c:\Program Files\BOINC\boinc.exe" -allow_multiple_clients -dir c:\Multiboinc\BOINC_%X -gui_rpc_port 50%X
I know the command in Linux, sort of for starting BOINC is this
boinc --daemon --allow_multiple_clients --dir /multiboinc/boinc_%X -gui_rpc_port 50%X
Do note I don't know the linux equivalent for "/boinc_%X" and "50%X" an example command to start one instance would be this
boinc --daemon --allow_multiple_clients --dir /multiboinc/boinc2/ -gui_rpc_port 502
This is for a distribute computing software called BOINC. Some of these projects only send 1 "task" per instance, but my rig is powerful enough to handle 100s of these tasks at once, so I make multiple instances of the BOINC client and run the projects on each instance individually so I can max out the systems resources.