📄 auto_ct2ps.sh
字号:
#!/bin/sh# auto_ct2ps# runs awk to split a multi-structure ct file into single structure# files, then runs sir_graphif [ $# -lt 1 ]; then echo -e " *** Usage: auto_ct2ps in_fil1 [o]\n\tsuffix .ct is assumed for in_fil1\n\to is optional - (o)verwrite existing file in_fil1.ps"elif [ -s $1.ct ]; then if [ $# -lt 2 ]; then overw=null else overw=$2 fi if [ -s $1_1.ct -a $overw != "o" ]; then echo -e "*** A file named \"$1\"_1.ct already exists . . ." echo -e "\tUse: auto_ct2ps "$1" o to overwrite this file." else count=`awk ' BEGIN { count = 0; CurrentFile = prefix; } $3 ~ /\=/ { if ( CurrentFile != prefix ) close(CurrentFile); count++; CurrentFile = prefix "_" count ".ct"; } { print $0 > CurrentFile; } END { if ( count ) close(CurrentFile); print count; }' prefix=$1 $1.ct` while [ "$count" -gt 0 ]; do sir_graph_ng -p $1_$count.ct > /dev/null echo -e "====> New PostScript plot file is $1_$count.ps" sir_graph_ng -n -o $1_$count-n -p $1_$count.ct > /dev/null echo -e "====> New PostScript natural plot file is $1_$count-n.ps" count=`expr $count - 1` done## \rm $1_*.ct fielse echo -e " *** in_fil1 \"$1.ct\" does not exist or is empty.\n"fi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -