Created
August 10, 2023 07:03
-
-
Save ryul99/6c77b4dbdd1af7d67c71ee209b5b4b7c to your computer and use it in GitHub Desktop.
wait function for any pid without see "pid is not a child of this shell"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# https://unix.stackexchange.com/a/427133 | |
if [ `uname` == "Linux" ]; then | |
tail --pid=$1 -f /dev/null | |
else | |
lsof -p $1 +r 1 &>/dev/null | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment