204N/A# The contents of this file are subject to the terms of the 204N/A# Common Development and Distribution License (the "License"). 204N/A# You may not use this file except in compliance with the License. 204N/A# See the License for the specific language governing permissions 204N/A# and limitations under the License. 204N/A# When distributing Covered Code, include this CDDL HEADER in each 204N/A# If applicable, add the following below this CDDL HEADER, with the 204N/A# fields enclosed by brackets "[]" replaced with your own identifying 204N/A# information: Portions Copyright [yyyy] [name of copyright owner] 6278N/A# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. 204N/A# Unfortunately, the gnuplot demo wants run in the 204N/A# create files. But ordinary users can't create files there. So 204N/A# we will create a temporary directory, put in symlinks to the 204N/A# gnuplot data files, and run the gnuplot command from there. 204N/A# This will allow us to run the gnuplot demo from any directory. 204N/A# If the environment variable $GNUPLOT_DEMO_SAVE_FILES is set to y, 204N/A# then we will save any new files that get created back to the 204N/A# current directory. This can also be accomplished by 204N/A# "rundemo -save-files". 204N/A# There are two font files that are not included. Set 204N/A# With no arguments we will run the default demo. 204N/A# With arguments we will run gnuplot with those arguments. 204N/A# One easy way to run the gnuplot demo is "rundemo < /dev/null" 204N/Aif [
"x$1" =
"x-save-files" ]
204N/Aelif [
"x$1" =
"x-delete-files" ]
204N/A# if we are interrupted or terminated, remove the temporary 204N/A# directory we will create. 204N/A# Create a writeable temporary directory to run the demo from. 204N/A# Make symlinks in that directory to the demo sources 204N/A# Run the gnuplot demo in that directory. 204N/A# Save the gnuplot exit status 204N/A# If desired save any new files that got created in the temporary 204N/A# Remove the temporary directory 204N/A# exit with the exit status from the gnuplot command