Given the PID of the first process, the loop
while ps -p $PID; do sleep 1; done ; script2
should do the trick. This is a little more stable than pgrep and process names.
More Related Contents:
- Linux Script to check if process is running and act on the result
- Linux/Unix command to determine if process is running?
- How to get the start time of a long-running Linux process?
- sh: 1: Syntax error: "(" unexpected error
- How do I write a bash script to restart a process if it dies?
- How to compare two strings in dot separated version format in Bash?
- Use Expect in a Bash script to provide a password to an SSH command
- What killed my process and why?
- How do I write standard error to a file while using “tee” with a pipe?
- What does $@ mean in a shell script?
- Threads vs Processes in Linux [closed]
- Raise error in a Bash script
- Separately redirecting and recombining stderr/stdout without losing ordering
- Print a file, skipping the first X lines, in Bash [duplicate]
- How can I get unique values from an array in Bash?
- Recursively counting files in a Linux directory
- Managing log files created by cron jobs
- How to run a shell script on a Unix console or Mac terminal?
- How to get the process ID to kill a nohup process?
- Use sudo without password INSIDE a script
- Run text file as commands in Bash
- How can I suppress error messages of a command?
- Shebang line limit in bash and linux kernel
- Programmatically get parent pid of another process?
- Bash: wait with timeout
- How do you search for files containing DOS line endings (CRLF) with grep on Linux?
- Randomly shuffling lines in Linux / Bash
- How to check if a program is run in Bash on Ubuntu on Windows and not just plain Ubuntu?
- What are the rules for valid identifiers (e.g. functions, vars, etc) in Bash?
- Bash `wait` command, waiting for more than 1 PID to finish execution