From the command line, typing cat
waits for user input.
But in the following script, wait
ignores the background process.
#!/bin/bash
cat &
wait
echo "After wait"
This script immediately blasts right past the wait
command. How can I make wait
actually wait for the cat command to finish? I've tried waiting for the specific PID or job number, but the effect is the same.