Created
December 4, 2011 03:19
-
-
Save geta6/1429028 to your computer and use it in GitHub Desktop.
ウィンドウが単一のときterminal.appをkillします、bashでも動きます
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
#!/bin/zsh | |
alias quit=killterm | |
killterm(){ | |
_WIN=$(( `w | wc -l`-3 )) | |
_PID=`ps ax | grep Terminal | grep -v grep | sed -e 's/ *\([0-9]*\).*/\1/g'` | |
[[ -z ${WINDOW} ]] && [[ 1 -eq ${_WIN} ]] && [[ -n ${_PID} ]] && kill ${_PID} | |
exit | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment