I often start a long running command that is bound to either CPU, Disk, RAM or Internet connection. While that is running, I find that I want to run a similar command. Let's say downloading something big.
Then I start a shell with wget ...1
and let it run. I could open another shell and run the other wget ...2
, but now they would fight for the bandwidth. When I just type the second command into the running shell, it will execute that later on, since wget
is not interactive.
Is there a reasonable way to do this with either Bash or Fish Shell?
bash
has a builtin command namedwait
. You can use it on PIDs or job numbers. To try it out, issue asleep 15 &
and then await %1 ; echo hi
. As I said you can also specify a PID instead of the%n
. – mreithub May 26 '14 at 19:02sleep 100 ; echo test
echo
will be executed immediately after ctrl+z. – rush May 28 '14 at 10:52