5
3
I found the following shell script that can be used to tell an OS X application to quit:
#!/bin/sh
echo | osascript <<EOF
tell application "$*"
quit
end tell
EOF
I have several simple alias commands in my .bash_profile and would like to add a "quit" command there instead of using this script. I created the following, but it doesn't work:
alias quit='osascript -e "quit application \"$1\""'
I'm sure I've munged the command. Any advice?
tell application "$*" to quit
is more compact. – Daniel Beck – 2010-12-16T02:02:09.147@DanielBeck: I've edited it to remove other redundancies as well, such as defining an alias whose only purpose is to call the function. I left the HEREDOC-style quoting as I was having problems with alternatives and grew impatient ;) – iconoclast – 2013-10-04T00:28:02.293