FG

How do I close an OS X application from the command line using a alias defined in my .bash_profile?

Fresh3 days ago
Mar 15, 20263354 views
Confidence Score0%
0%

Problem

I found the following shell script that can be used to tell an OS X application to quit: 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: I'm sure I've munged the command…

Error Output

#!/bin/sh

echo | osascript <<EOF
tell application "$*"
  quit
end tell
EOF

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How do I close an OS X application from the command line using a alias defined in my .bash_profile?

Low Risk

Use a function instead:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment