📄 edemos.sh
字号:
#! /bin/sh# top level script for ERL demos# @(#)edemos.sh 1.7 11/2/92 ERL## Called with one (optional) argument## $1 = path to top directory for temporary files#set -xEXTRASMENU=/dev/nullexport EXTRASMENU# check ELM_HOSTif test x$ELM_HOST = xthen echo "" echo You do not have ELM_HOST set. Please set this environment variable echo to the hostname on which the Entropic license manager is running. exit 1fi# check syntaxcase $# in1) # any output files go in directory specified by $1 # note that this may lead to collisions if it's reused demo_temp=$1 demo_temp_specified=1 ;;*) demo_temp=$HOME/Edemo$$ echo "no temporary directory specified, will use $demo_temp" ;;esac# make sure ESPS license is checked out, if possible. This is # harmless is one is already checked out. get_lic=`get_esps_base`/bin/echeckout$get_lic > /dev/null 2>&1# create temp directory if necessary, check that it is writableif test ! -d $demo_tempthen mkdir $demo_temp > /dev/null 2>&1fitouch $demo_temp/foo.$$ > /dev/null 2>&1if test -f $demo_temp/foo.$$ then rm $demo_temp/foo.$$ else echo "$0: can't create $demo_temp or can't write in it; exiting. " exit 1fi# make sure we have full path for temp directorycur_dir=`pwd`cd $demo_tempdemo_temp=`pwd`cd $cur_dir# If we are not in the main demo directory, we try to find it # and switch to it. if test -f demo_menu then demo_dir=`pwd` else demo_dir=`get_esps_base`/newdemosfiif test ! -d $demo_dir then echo "$0: Couldn't find demo directory; exiting." exit 1fidemo_menu=$demo_dir/demo_menu# cd $demo_dir > /dev/null 2>&1cd $demo_dir # insert temp directory in standard demo menu filesed s%@DEMO_TEMP@%$demo_temp% $demo_menu > $demo_temp/entropic.MB# bring up main button panelmbuttons -w "Entropic Demos" -i Edemos -X1 -Y1 -q1 $demo_temp/entropic.MB # after mbuttons exits, we remove the temp directory# unless it appears that a demo is running# NOTE: here we exploit the lock file set from edemos.sh# if the user specified the temp directory, we don't remove itif test x$demo_temp_specified != xthen exitfilockfile=$demo_temp/demo.lockmessage=$demo_temp/errormessif test -f $lockfilethen rm -f $message cat > $message << EOFNOTE: It appears that a demo is currently running, so the temp directory $demo_temp was not removed. EOF xtext -Wp 0 0 -t "DEMO ERROR" -F $message & exit 1else rm -rf $demo_tempfi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -