ghong6003的个人空间 https://blog.eetop.cn/1430538 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

run_pt.sh

已有 585 次阅读| 2018-3-6 22:23 |个人分类:Shell|系统分类:芯片设计

#!/bin/bash -


##################################################
# This scripts is uesed to run PrimeTime,
# You could get help by type "run_pt.bash -h"
#################################################


# Function: Usage
Usage () {
echo "**************************************************" >&2
echo "[Usage] Below options are used:" >&2
echo "-h                       : Get this help description;" >&2
echo "-d                       : Run PrimeTime in Debug Mode;" >&2
echo "-l (1/0)                 : 1 -> Run PrimeTime on Local Machine;" >&2
echo "                           0 -> Run PrimeTime on Server(Default);" >&2
echo "-f Constraints_file      : Run PrimeTime in Debug Mode;" >&2
echo "-s Session_name          : Run PrimeTime and restore the Session;" >&2
echo "(No option)              : Run PrimeTime with your latest setting.\n" >&2
echo "Example: $0 -d" >&2
echo "Example: $0 -d -s Session" >&2
echo "**************************************************" >&2
exit
}

# *******************************************************
# Function Blocks
# *******************************************************
# Function: Pt_Local
#Pt_Local () {
#if test -h $1
#then
#cp $1 ${1}.old
#unlink $1
#mv ${1}.old $1
#printf "[Info]: %20s unlink done!!\n" $1
#else
#printf "[Info]: %20s isn't a link file!!\n" $1
#fi
#}

# Function: Pt_Server
#Pt_Server () {

#}

# Function: run_mac
#run_pt () {

#}

# Function: Resave_option
Resave_option () {
echo "File=$file" > .run_pt.option.log
echo "Debug=$debug" >> .run_pt.option.log
echo "Session=$session" >> .run_pt.option.log
#if test -h .run_pt.option.log
#then
#'rm .run_pt.option.log' 
#'touch .run_pt.option'
#else
#echo "[Warning]Firsrt time run PrimeTime or lost the latest option setting" >&2
#echo "Please use more detailed options." >&2
#fi
}

# Function: Restore_option
Restore_option () {
while read line
do
tmp=${line#*=}
echo "$tmp"
#case $line in
#-f) file=$2
#shift 2
#;;
#-s | -session) session=$2
#shift 2
#;;
#-d) debug=1
#shift
#;;
#-h | -help) Usage
#exit 1
#;;
#-l) machine=$2
#shift 2
#;;
#--) shift
##break
#;;
#-*) echo $0:$1 : unrecognised option >&2
#shift
#;;
#esac

done < .run_pt.option.log
}

# Function: Option_check

# *******************************************************
# Main Process Begin Here
# *******************************************************
# Parameter Setting
file=
session=
debug=0
machine=0

if [[ $# = 0 && -e .run_pt.option.log ]]; then
echo "***********************************************" >&2
echo "[Info]: Use your latest setup to run PrimeTime;" >&2
echo "***********************************************" >&2
elif [[ $# = 0 ]]; then
echo "***********************************************" >&2
echo "[Warning]: No history Setting log, Pls refer below:" >&2
Usage
echo "***********************************************" >&2

fi

# Main Function
while [ $# -gt 0 ]
do
echo $#
case $1 in
-f) file=$2
shift 2
;;
-s | -session) session=$2
shift 2
;;
-d) debug=1
shift
;;
-h | -help) Usage
exit 1
;;
-l) machine=$2
shift 2
;;
--) shift
#break
;;
-*) echo $0:$1 : unrecognised option >&2
shift
;;
esac
done

Restore_option
Resave_option

exit


#echo $*
#for i in $*
#do
# if test -h $i
# then
# cp $i ${i}_1
# unlink $i
# mv ${i}_1 $i
# printf "[Info]: %20s unlink done!!\n" $i
# else
#
# printf "[Info]: %20s isn't a link file!!\n" $i
# fi
#done


#while [ $# -gt 0 ]
#do
# if test -h $i
# then
# ehco "$i"
# mv $i ${i}_1
# unlink $i
# mv ${i}_1 $i
# else
# echo "$i isn't a link!!"
# fi
# shift
#done



点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 1

    关注
  • 3

    粉丝
  • 0

    好友
  • 2

    获赞
  • 1

    评论
  • 1539

    访问数
关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-23 23:16 , Processed in 0.013836 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部