mathiasbynens / dotfiles

:wrench: .files, including ~/.macos — sensible hacker defaults for macOS
https://mths.be/dotfiles
MIT License
30.15k stars 8.74k forks source link

.osx: Kill affected applications #115

Open mourawaldson opened 12 years ago

mourawaldson commented 12 years ago

You are printing a message after kill the Terminal, the message will never show up.

I'm applying this to my .osx

###############################################################################
# Kill affected applications or restart the system                            #
###############################################################################

echo "Done. Note that some of these changes require a logout/restart to take effect."
echo "To restart the system press [r] or to kill affected apps press [k]"

read option

if [ $option == "r" ]; then
    sudo shutdown -r now
elif [ $option == "k" ]; then
    for app in "Address Book" "Contacts" "iCal" "Calendar" "Dock" "Finder" "Mail" \
        "Safari" "iTunes" "SystemUIServer" "Terminal" "Twitter"; do
        killall "$app" > /dev/null 2>&1
    done
fi

what do you think about this?

mathiasbynens commented 12 years ago

You are printing a message after kill the Terminal, the message will never show up.

It does if you use iTerm or another application instead (like I do).

mourawaldson commented 12 years ago

Hmm.. I got it, but this way will work for everyone, anyway, it's up to you, it's just a suggestion, I just did it, cause I really liked the .osx =) Thanks for your attention.

danispringer commented 5 years ago

You are printing a message after kill the Terminal, the message will never show up.

It does if you use iTerm or another application instead (like I do).

Is there a way to have that message pop up as an alert or something, if one does use Terminal?

I wasn't sure at what point the file made everything crash so I added an echo before each line, only to find out the obvious, namely that it didn't make anything crash, but reached the point where Terminal gets killed 😄