Registered Member
|
Hello Guys,
I am using the unrar e command to unrar big files (50GB+) directly from the NAS. I have many files so I want a way to add a "to do list" that will unrar all the files in that list one by one and not all together. Is that possible? |
Registered Member
|
Hi!
You could use the wait command in bash to wait for the process to finish. Just use without arguments or give it the pid of the current running process. |
Registered Member
|
Hello!
thank you for your answer. No idea how to do that. For now I just "open a terminal here" and once I am in the folder I want I type: Unrar e blabla.rar Then i proceed to the next one and as a result they all start up together. What I want is a way to do this but only go the next rar project once the first one is complete. Thank you in advance! |
Registered Member
|
The bash normally waits for a process to finish, so you do not have to keep care of.
Try following: Create a dummy-script which does nothing but echo and sleep for 5 seconds:
Create a second script (or run from command line):
This loop starts the script three times and prints its value via dummy-script and waits for the first run to "finish". Next one will show the difference between default behaviour, background-processes and wait. Default is to wait for a process to finish and continue. With the ampersand you can move the process to background and perform the next step without waiting. At least one way of how wait works, simulating the default behaviour and waiting for a process to finish before next step.
|
Registered users: Bing [Bot], Evergrowing, Google [Bot]