procvter
来自「proe5.0野火版下载(中文版免费下载)」· 代码 · 共 2,131 行 · 第 1/5 页
TXT
2,131 行
set def="0"if ("$prj_conv" != "") set killdelay="$def"while ("$killdelay" == "") echo "Maximum time for any file conversion (choice: number of mins, 0 = unlimited)" echo -n "[$def] ?: " set killdelay="$<" if ("$killdelay" == "") set killdelay="$def" echo ""endset def="/tmp"set tmpdir="$unsetdir_val"while (! -d $tmpdir) echo "Temporary work directory" echo -n "[$def] ?: " set tmpdir="$<" if ("$tmpdir" == "") set tmpdir="$def" set tmpdir=`(cd $tmpdir; echo $cwd)` if (! -d "$tmpdir") echo "ERROR: '$tmpdir' does not exist" echo ""endset min_space=""set def="0"if ("$prj_conv" != "") set min_space="$def"while ("$min_space" == "" && "$prj_conv" == "") echo "Minimum disk space for any conversion (choice: size in Kb, 0 = unlimited)" echo -n "[$def] ?: " set min_space="$<" if ("$min_space" == "") set min_space="$def" echo ""endset backup_ok=""set user_cfgfile=""if ("$prj_conv" == "") then set def="existing" ASK_CFG_NAME: echo "Name of a config. file to use (choice: none, existing OR a filename)" echo -n "[$def] ?: " set user_cfgfile="$<" if ("$user_cfgfile" == "") set user_cfgfile="$def" if ("$user_cfgfile" == "none" || "$user_cfgfile" == "existing") goto CFG_NAME_DONE if (-e "$user_cfgfile") goto CFG_NAME_DONE echo "ERROR: file does not exist - '$user_cfgfile'" goto ASK_CFG_NAME CFG_NAME_DONE: echo ""endif# Don't ask about following - intended for in-house args mode onlyset validservs="all"set ftab="no"set runmode="-1"else ### NON-CONVERSATIONAL INPUT MODE ##### VALIDATE PARAMETERS## MUST HAVE P1set procmd="$arglist[1]" # P1 no defaultif ("$procmd" == "" || "$procmd" =~ -*) goto USAGEset bad_procmdif ($?use_which) then set procmd=`which $procmd |& tail -1` if (-x "$procmd") unset bad_procmdelse set procmd="/bin/$procmd" if (-x "$procmd") unset bad_procmdendifif ($?bad_procmd) then echo "" repeat $lm echo -n " "; echo "ERROR: '$procmd' no such command" exit 1endif# set proe_lp to point to the install directory# used later to check config.supset fullprocmdname=`ls -l $procmd | awk '{print $NF}'`set t_procmdname="$fullprocmdname:t"set h_procmdname="$fullprocmdname:h"set proe_lpif ($h_procmdname == $t_procmdname) then set proe_lp="$cwd:h"else pushd $h_procmdname set proe_lp="$cwd:h" popdendifunset h_procmdnameunset t_procmdnameunset fullprocmdname# ESTABLISH PRE-PARAMETER DEFAULTS if ($?import_mode) then# impfmt - must be set by parameter# papersize - undocumented only needed for 7.0, provided for emergency only set impext="igs" set purgefiles="" set forceconvert="" set prjdir=""else set impext="" set purgefiles="___UNDEFINED___" set forceconvert="no" set prjdir="no"endifset impfmt=""set papersize=""set list=""set startdir="___UNDEFINED___"set targetdir="___UNDEFINED___"set geommode="nogeom"set storemode="long"set descend="___UNDEFINED___"set killdelay=0set backup_ok=""set tmpdir="/tmp"set min_space=0set user_cfgfile="existing"set validservs="all" # undocumented switchset ftab="no" # undocumented switchset runmode="-1" # undocumented switchset prj_name=""set prj_conv=""# OVERRIDE DEFAULTS WITH PARAMETERSset argnum="$#arglist"unset missingparset i="2"while ($i <= $argnum && ! $?missingpar) set curpar="$arglist[$i]" switch ($curpar) case -help goto USAGE breaksw case -if if (! $?import_mode) goto BAD_PARAM @ i++ if ($i > $argnum) then set missingpar else set impfmt="$arglist[$i]" endif breaksw case -ps if (! $?import_mode) goto BAD_PARAM @ i++ if ($i > $argnum) then set missingpar else set papersize=`echo "$arglist[$i]" | tr '[a-z]' '[A-Z]'` endif breaksw case -ie if (! $?import_mode) goto BAD_PARAM @ i++ if ($i > $argnum) then set missingpar else set impext="$arglist[$i]" endif breaksw case -s @ i++ if ($i > $argnum) then set missingpar else set startdir="$arglist[$i]" endif breaksw case -l @ i++ if ($i > $argnum) then set missingpar else set list="$arglist[$i]" endif breaksw case -t @ i++ if ($i > $argnum) then set missingpar else set targetdir="$arglist[$i]" endif breaksw case -geom set geommode="geom" breaksw case -p if ($?import_mode) goto BAD_PARAM set purgefiles="yes" breaksw case -r set descend="yes" breaksw case -f if ($?import_mode) goto BAD_PARAM set forceconvert="yes" breaksw case -k @ i++ if ($i > $argnum) then set missingpar else set killdelay="$arglist[$i]" endif breaksw case -tmp @ i++ if ($i > $argnum) then set missingpar else set tmpdir="$arglist[$i]" endif breaksw case -ms @ i++ if ($i > $argnum) then set missingpar else set min_space="$arglist[$i]" endif breaksw case -ok set backup_ok="yes" breaksw case -c @ i++ if ($i > $argnum) then set missingpar else set user_cfgfile="$arglist[$i]" endif breaksw case -prjdir if ($?import_mode) goto BAD_PARAM set prjdir="yes" breaksw case -servs @ i++ if ($i > $argnum) then set missingpar else set validservs="$arglist[$i]" # undocumented switch endif breaksw case -ftab set ftab="yes" breaksw case -run @ i++ if ($i > $argnum) then set missingpar else set runmode="$arglist[$i]" # undocumented switch endif breaksw case -prj_name if ($?import_mode) goto BAD_PARAM @ i++ if ($i > $argnum) then set missingpar else set prj_name="$arglist[$i]" # undocumented switch endif breaksw case -prj_conv if ($?import_mode) goto BAD_PARAM @ i++ if ($i > $argnum) then set missingpar else set prj_conv="$arglist[$i]" # undocumented switch endif breaksw default BAD_PARAM: echo "" echo "ERROR: illegal parameter: '$curpar'" echo "" goto USAGE breaksw endsw @ i ++endif ($?missingpar) then echo "ERROR: must supply a string after -s,-l,-t,-k, -tmp, -c or -prj_name" exit 1endif# ESTABLISH POST-PARAMETER DEFAULTSif ("$prj_name" == "" && "$prj_conv" == "") then if ("$startdir" == "___UNDEFINED___") set startdir="$cwd" if ("$targetdir" == "___UNDEFINED___") set targetdir="$startdir" if ("$purgefiles" == "___UNDEFINED___") set purgefiles="no" if ("$descend" == "___UNDEFINED___") set descend="no"else set startdir="" set targetdir="" set purgefiles="" set descend="" if ("$prj_conv" != "") then set geommode="" set storemode="" set forceconvert="" set user_cfgfile="" set prjdir="" endifendifif ($?import_mode) then if ("$impfmt" == "") then echo "ERROR: you must specify the import format using -if." exit 1 endif if ("$impfmt" == "prt") set papersize=""endifif ($?cvt8_mode) then if ("$prj_conv" == "") then echo "ERROR: you must specify the project to convert using -prj_conv." exit 1 endifendifendif ### INPUT MODE #### MAKE SURE USER IS WARNED ABOUT BACKUPSset def="no"set choice=" yes no "while (`echo "$choice" | grep " $backup_ok " | wc -l` == 0) echo "Satisfied with the backup of the files to be converted (choice: $choice)" echo -n "[$def] ?: " set backup_ok="$<" set backup_ok=`echo "$backup_ok" | tr \[A-Z\] \[a-z\] | tr -d ' '` if ("$backup_ok" == "") set backup_ok="$def" if ("$backup_ok" =~ y*) set backup_ok="yes" if ("$backup_ok" =~ n*) set backup_ok="no" echo ""endif ("$backup_ok" == "no") then echo "" echo "Re-run $name after backing up the files to be converted." echo "" exit 0endifif ($?import_mode && "$impfmt" != "drw" && "$impfmt" != "prt") then echo "ERROR: -if $impfmt - valid formats are: drw or prt" exit 1endif# CHECK PARS THAT ARE FREE-FORMATif ("$startdir" != "") then if (! -d $startdir) then echo "ERROR: -s; '$startdir' - no such directory exists" exit 1 endif set startdir=`(cd $startdir; echo $cwd)`endifif ("$list" != "") then if ("$list:h" == "$list:t") set list="$initialdir/$list" if (! -e "$list") then echo "ERROR: -l; '$list' - no such file exists" exit 1 endifendifif ("$targetdir" != "") then if (! -d "$targetdir") then mkdir "$targetdir" if ($status) then echo "ERROR: -t; '$targetdir' - can't create this dir" exit 1 endif endif touch "$targetdir"/convert.$pid if ($status) then echo "ERROR: -t; '$targetdir' - can't write into this dir" exit 1 endif rm -f $targetdir/convert.$pid set targetdir=`(cd $targetdir; echo $cwd)`endifif ("$killdelay" < 60 && "$killdelay" != 0) then echo "" echo "WARNING: Maximum file conversion time ($killdelay mins) is less than 1 hour." echo " This may be too short a time." echo ""endifset killdelay_secs=`echo "$killdelay * 60" | bc`
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?