Created
February 11, 2019 04:32
-
-
Save J-Swift/889e5255137c1cf10bcb06b5fd428698 to your computer and use it in GitHub Desktop.
bash alias to exit if no jobs suspended
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
function fge() { | |
# https://unix.stackexchange.com/a/251050 | |
local -r num_suspended=$(jobs -s | wc -l) | |
if [ $num_suspended -eq 0 ]; then | |
exit | |
else | |
fg | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment