📄 mkudndir.ksh
字号:
#! /bin/ksh### Copyright 1992# Georgia Tech Research Corporation# All Rights Reserved.# This material may be reproduced by or for the U.S. Government# pursuant to the copyright license under the clause at DFARS# 252.227-7013 (Oct. 1988)## MKUDNDIR - create a User-Defined Node directory and install default template files## NOTE: must use ksh since Apollo sh does not support shell functions.## usage: mkudndir [directory] [-n node-type-name]## If the names are not given on the command line, they are read# interactively.## Bill Kuhn - November 11 1991 - Copied and adapted from mkmoddir by Stever Tynor## Include global XSPICE definitions. /usr/local/xspice-1-0/include/shell.includetemplate_dir=$ROOT/lib/cmt/mkudndirtempl_mf=$template_dir/Makefile.tpltempl_udn=$template_dir/udnfunc.tplprog=$0usage (){ echo echo Error: $* echo usage: mkudndir [directory] [-n node-type-name] echo exit 1}dirname=nodename=# Get command line argumentsechowhile [ -n "$1" ]do case $1 in -n) if [ -n "$nodename" ] then usage SPICE Model name already set. fi shift nodename=$1 ;; ?*) if [ -n "$dirname" ] then usage Directory name already set. fi dirname=$1 ;; esac shiftdone# Prompt for any required names not given on command lineif [ -z "$dirname" ]then echo -n "Directory name: " read dirnamefiif [ -z "$nodename" ]then nodename=`basename $dirname` echo -n "Node type name ["$nodename"]: " read tmp if [ -n "$tmp" ] then nodename=$tmp fifiif [ -z "$dirname" -o -z "$nodename" ]then echo echo ERROR: invalid directory, or udn type name. echo exit 1fi# Create the new directoryechomkdir $dirnameif [ 0 != $? ]then echo echo ERROR: mkdir failed - unable to create model directory: $dirname. echo exit 1fi# Copy over file templates and run "sed" to use user-supplied# namecp $templ_mf $dirname/Makefileif [ 0 != $? ]then echo echo ERROR: Makefile template copy failed. echo exit 1fised -e "s/NODE_TYPE_NAME/$nodename/g" \ $templ_udn > $dirname/udnfunc.cif [ 0 != $? ]then echo echo ERROR: udnfunc.c template copy failed. echo exit 1fi# Report successechoecho User-Defined Node directory \"$dirname\" created.echoecho Edit file \"udnfunc.c\" to define your node type.echo Then run \"make\" to compile it.echoexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -