author | Tomas Klacko <tomas.klacko@oracle.com> |
Tue, 25 Mar 2014 10:51:42 +0100 | |
branch | s11u1-sru |
changeset 3011 | 9265805e77d5 |
parent 204 | 78dfe4707c7c |
child 6280 | 203b97a7f889 |
permissions | -rw-r--r-- |
204
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
1 |
#!/bin/sh |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
2 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
3 |
# |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
4 |
# CDDL HEADER START |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
5 |
# |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
6 |
# The contents of this file are subject to the terms of the |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
7 |
# Common Development and Distribution License (the "License"). |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
8 |
# You may not use this file except in compliance with the License. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
9 |
# |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
10 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
11 |
# or http://www.opensolaris.org/os/licensing. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
12 |
# See the License for the specific language governing permissions |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
13 |
# and limitations under the License. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
14 |
# |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
15 |
# When distributing Covered Code, include this CDDL HEADER in each |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
16 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
17 |
# If applicable, add the following below this CDDL HEADER, with the |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
18 |
# fields enclosed by brackets "[]" replaced with your own identifying |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
19 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
20 |
# |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
21 |
# CDDL HEADER END |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
22 |
# |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
23 |
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
24 |
# |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
25 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
26 |
# Unfortunately, the gnuplot demo wants run in the |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
27 |
# /usr/demo/gnuplot directory. While there it wants to read and |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
28 |
# create files. But ordinary users can't create files there. So |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
29 |
# we will create a temporary directory, put in symlinks to the |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
30 |
# gnuplot data files, and run the gnuplot command from there. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
31 |
# This will allow us to run the gnuplot demo from any directory. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
32 |
# |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
33 |
# If the environment variable $GNUPLOT_DEMO_SAVE_FILES is set to y, |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
34 |
# then we will save any new files that get created back to the |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
35 |
# current directory. This can also be accomplished by |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
36 |
# "rundemo -save-files". |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
37 |
# |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
38 |
# There are two font files that are not included. Set |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
39 |
# corresponding environment variables for sfrm1000.pfb and |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
40 |
# cmmi10.pfb if running the demo fontfile_latex.dem. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
41 |
# |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
42 |
# With no arguments we will run the default demo. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
43 |
# With arguments we will run gnuplot with those arguments. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
44 |
# One easy way to run the gnuplot demo is "rundemo < /dev/null" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
45 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
46 |
GNUPLOT_DEMO_DIR="${GNUPLOT_DEMO_DIR:-/usr/demo/gnuplot}" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
47 |
GNUPLOT_DEMO_PROGRAM="${GNUPLOT_DEMO_PROGRAM:-gnuplot}" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
48 |
GNUPLOT_DEMO_DEFAULT="${GNUPLOT_DEMO_DEFAULT:-all.dem}" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
49 |
GNUPLOT_DEMO_GSFONTS="${GNUPLOT_DEMO_GSFONTS:-/usr/share/ghostscript/fonts}" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
50 |
GNUPLOT_DEMO_P052003L_PFB="${GNUPLOT_DEMO_P052003L_PFB:-$GNUPLOT_DEMO_GSFONTS/p052003l.pfb}" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
51 |
GNUPLOT_DEMO_P052023L_PFB="${GNUPLOT_DEMO_P052023L_PFB:-$GNUPLOT_DEMO_GSFONTS/p052023l.pfb}" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
52 |
GNUPLOT_DEMO_TMPDIR="/tmp/gnuplot_demo_`logname`_$$" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
53 |
GNUPLOT_DEMO_LIST="$GNUPLOT_DEMO_DIR/*.bin \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
54 |
$GNUPLOT_DEMO_DIR/*.cfg \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
55 |
$GNUPLOT_DEMO_DIR/*.cor \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
56 |
$GNUPLOT_DEMO_DIR/*.csv \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
57 |
$GNUPLOT_DEMO_DIR/*.dat \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
58 |
$GNUPLOT_DEMO_DIR/*.dem \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
59 |
$GNUPLOT_DEMO_DIR/*.edf \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
60 |
$GNUPLOT_DEMO_DIR/*.fnc \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
61 |
$GNUPLOT_DEMO_DIR/*.inc \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
62 |
$GNUPLOT_DEMO_DIR/*.par \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
63 |
$GNUPLOT_DEMO_DIR/*.pdb \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
64 |
$GNUPLOT_DEMO_DIR/*.r3d \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
65 |
$GNUPLOT_DEMO_DIR/*.rgb \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
66 |
$GNUPLOT_DEMO_DIR/*.rot \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
67 |
$GNUPLOT_DEMO_DIR/binary[123] \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
68 |
$GNUPLOT_DEMO_DIR/bldg.png \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
69 |
$GNUPLOT_DEMO_DIR/gnu-valley \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
70 |
$GNUPLOT_DEMO_DIR/random-points \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
71 |
$GNUPLOT_DEMO_P052003L_PFB \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
72 |
$GNUPLOT_DEMO_P052023L_PFB \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
73 |
$GNUPLOT_DEMO_CMMI10_PFB \ |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
74 |
$GNUPLOT_DEMO_SFRM1000_PFB" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
75 |
GNUPLOT_DEMO_SAVE_FILES=${GNUPLOT_DEMO_SAVE_FILES:-n} |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
76 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
77 |
if [ "x$1" = "x-save-files" ] |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
78 |
then |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
79 |
GNUPLOT_DEMO_SAVE_FILES="y" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
80 |
shift |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
81 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
82 |
elif [ "x$1" = "x-delete-files" ] |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
83 |
then |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
84 |
GNUPLOT_DEMO_SAVE_FILES="n" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
85 |
shift |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
86 |
fi |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
87 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
88 |
# if we are interrupted or terminated, remove the temporary |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
89 |
# directory we will create. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
90 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
91 |
if [ "$GNUPLOT_DEMO_SAVE_FILES" = "y" ] |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
92 |
then |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
93 |
trap "find $GNUPLOT_DEMO_TMPDIR -type f -a -exec cp -p {} . \; ; rm -rf $GNUPLOT_DEMO_TMPDIR; exit 1" INT TERM |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
94 |
else |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
95 |
trap "rm -rf $GNUPLOT_DEMO_TMPDIR; exit 1" INT TERM |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
96 |
fi |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
97 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
98 |
# Create a writeable temporary directory to run the demo from. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
99 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
100 |
mkdir $GNUPLOT_DEMO_TMPDIR |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
101 |
chmod u+rwx $GNUPLOT_DEMO_TMPDIR |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
102 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
103 |
# Make symlinks in that directory to the demo sources |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
104 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
105 |
for GNUPLOT_DEMO_FILE in $GNUPLOT_DEMO_LIST |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
106 |
do |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
107 |
ln -s $GNUPLOT_DEMO_FILE $GNUPLOT_DEMO_TMPDIR |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
108 |
done |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
109 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
110 |
# Run the gnuplot demo in that directory. |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
111 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
112 |
if [ "$#" -eq 0 ] |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
113 |
then |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
114 |
(cd $GNUPLOT_DEMO_TMPDIR; |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
115 |
exec $GNUPLOT_DEMO_PROGRAM $GNUPLOT_DEMO_DEFAULT) |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
116 |
else |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
117 |
(cd $GNUPLOT_DEMO_TMPDIR; |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
118 |
exec $GNUPLOT_DEMO_PROGRAM $*) |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
119 |
fi |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
120 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
121 |
# Save the gnuplot exit status |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
122 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
123 |
GNUPLOT_DEMO_EXITSTATUS="$?" |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
124 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
125 |
# If desired save any new files that got created in the temporary |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
126 |
# directory |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
127 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
128 |
if [ "$GNUPLOT_DEMO_SAVE_FILES" = "y" ] |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
129 |
then |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
130 |
find $GNUPLOT_DEMO_TMPDIR -type f -exec cp -p {} . \; |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
131 |
fi |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
132 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
133 |
# Remove the temporary directory |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
134 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
135 |
rm -rf $GNUPLOT_DEMO_TMPDIR |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
136 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
137 |
# exit with the exit status from the gnuplot command |
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
138 |
|
78dfe4707c7c
7028339 Desire to have gnuplot in userland gate
David Marx <David.M.Marx@Oracle.Com>
parents:
diff
changeset
|
139 |
exit $GNUPLOT_DEMO_EXITSTATUS |