Skip to content

Instantly share code, notes, and snippets.

@yanqd0
Created July 25, 2024 09:53
Show Gist options
  • Save yanqd0/adb56cb8599295b409368c798d32af9b to your computer and use it in GitHub Desktop.
Save yanqd0/adb56cb8599295b409368c798d32af9b to your computer and use it in GitHub Desktop.
Print something when waiting for background process.
#!/bin/bash
echo "$@"
"$@" &
jobs -n
while [[ -z $(jobs -n) ]]
do
echo Wait...
sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment