Mercurial > hg > mxe-octave-anirudha
comparison darwin_files/launch_octave.sh @ 3233:36f223faf601
[Darwin] Shell script to launch and quit Octave
author | Anirudha Bose <ani07nov@gmail.com> |
---|---|
date | Tue, 24 Sep 2013 00:05:47 +0530 |
parents | |
children | f9c5235c5688 |
comparison
equal
deleted
inserted
replaced
3232:acec083ac83b | 3233:36f223faf601 |
---|---|
1 #!/bin/sh | |
2 # Copyright (C) 2012, Ben Abbott | |
3 # This program is free software; you can redistribute it and/or modify | |
4 # it under the terms of the GNU General Public License as published by | |
5 # the Free Software Foundation; either version 3 of the License, or | |
6 # (at your option) any later version. | |
7 # | |
8 # This program is distributed in the hope that it will be useful, but | |
9 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
11 # General Public License for more details. | |
12 # | |
13 # You should have received a copy of the GNU General Public License | |
14 # along with this program; If not, see <http://www.gnu.org/licenses/>. | |
15 | |
16 # Checks if Octave is started from a file that is a link or if this | |
17 # file has been taken directly to startup the Octave program. | |
18 | |
19 if [ -L "$0" ] ; then | |
20 ROOT="$(dirname $(readlink -f "$0"))" | |
21 else | |
22 ROOT="$(cd "$(dirname "$0")" 2>/dev/null && pwd)" | |
23 fi | |
24 ROOT="$(dirname "${ROOT}")" | |
25 | |
26 "${ROOT}/bin/octave" | |
27 | |
28 # Use AppleScript to kill the icon in the dock. | |
29 # FIXME - how to replace "Octave-3.7.0+" with "Octave-$VER" | |
30 osascript 2>&1>/dev/null <<EOF | |
31 tell application "Octave-3.7.0+" | |
32 quit | |
33 end tell | |
34 EOF |