User avatar
Jeder neocat_floof_googly_woozy neocat_flag_agender 🔜 eth0 @jeder@miau.jeder.pl
3y
i hate when bash scripts that are supposed to do the same thing on every file in the folder don't do it at once so i have to jerryrig them into doing it
1
0
0
0

User avatar
Jeder neocat_floof_googly_woozy neocat_flag_agender 🔜 eth0 @jeder@miau.jeder.pl
3y
bash has the fucking & for a reason
use it
1
0
0
0
User avatar
Bex B. Sc. @sanity@nightcity.bar
3y
@jeder how do I wait for all of them to finish before continuing, though?
2
0
0
0
User avatar
Jeder neocat_floof_googly_woozy neocat_flag_agender 🔜 eth0 @jeder@miau.jeder.pl
3y
@sanity don't add & at the end of the last one i guess, or add && there
1
0
0
0
User avatar
Bex B. Sc. @sanity@nightcity.bar
3y
@jeder that doesn't work reliably, though, because the different processes might have different runtime and/or the scheduler of the OS might decide to schedule the processes in a way that leads to the last process to be started not to be the last process to finish.

The & will work for many things but if you have to make sure all of the processes have finished before you start the next set of tasks, you have to have a way to wait for them all. Idk how to do that in Bash or, for portability, in POSIX shell.
0
0
0
0
User avatar
[GRLC] ralseiblunt @novenary@akko.wtf
3y
@sanity @jeder the command for that is literally called wait
but also look up job control
3
0
0
0
User avatar
Jeder neocat_floof_googly_woozy neocat_flag_agender 🔜 eth0 @jeder@miau.jeder.pl
3y
0
0
0
0
User avatar
Bex B. Sc. @sanity@nightcity.bar
3y
@novenary @jeder thanks! I'll look into that.
⭐1
1
0
0
1
User avatar
[GRLC] ralseiblunt @novenary@akko.wtf
3y
@sanity @jeder xargs is also a decent alternative for parallelism btw
⭐1
0
0
0
1
User avatar
Bex B. Sc. @sanity@nightcity.bar
3y
0
0
0
0