特定のファイルを、与えた引数の値に変更するスクリプト
[sh]
#————————————————-
# PST value set
#————————————————-
# Argument checking
if [ “$1” != “1” ] && [ “$1” != “0” ];
then
echo ‘Not argument, Please Enter!’
exit;
fi
# Variable assignment
set_value_num=$1
array=(
“/tmp/proc_st/en.pst”
“/tmp/proc_st/finance.pst”
“/tmp/proc_st/game.pst”
“/tmp/proc_st/jpn_cn.pst”
“/tmp/proc_st/jpn_en.pst”
“/tmp/proc_st/jpn.pst”
“/tmp/proc_st/love.pst”
“/tmp/proc_st/memo.pst”
“/tmp/proc_st/pc-parts.pst”
“/tmp/proc_st/pub.pst”
“/tmp/proc_st/rg.pst”
“/tmp/proc_st/sys_en.pst”
“/tmp/proc_st/sys.pst”
“/tmp/proc_st/web-service.pst”
“/tmp/proc_st/zh.pst”
)
#————————————————-
# Processing
for (( I = 0; I < ${#array[@]}; ++I ))
do
# ${array[$I]}を使った処理
echo $set_value_num > ${array[$I]}
# echo $set_value_num
done
[/sh]
コメント