Shell Introduce 1
unixC Introduce
Unix Introduce
Perl Introduce 1
Perl Introduce 2
Date And Cal in Shell:
# 詳細日付の取得1
VeryDetailDate=`date +%Y%m%d%k%M%S%N`;
sed s/%VERYDETAILDATE%/$VeryDetailDate/ $filename > $fullDir/tmpFile;
sleep 0.2
# 詳細日付の取得1
detailDate=`date +%Y%m%d%H%M%S`;
sed s/%DETAILDATE%/$detailDate/ $fullDir/tmpFile |tee $fullDir/tmpFile 1>/dev/null;
sleep 1
# 日付と文字列の組合せ
result="LT"`date +%H`"-"`date +%M%S`;
sed s/%RESULT%/$result/ $fullDir/tmpFile |tee $fullDir/tmpFile 1>/dev/null;
# 日付の計算例
daysAgao=15;
calDate=`date --date ${daysAgao}' day 5 minutes ago' +%Y%m%d%k%M%S`;
sed s/%CALDATE%/$calDate/ $fullDir/tmpFile |tee $fullDir/tmpFile 1>/dev/null;
# 整数計算例
count=`expr $count + 1`;
# 浮動小数点計算例
dblVal=`echo "$vals + $loop" | bc -l`;
sed s/%$count%/$dblVal/ $fullDir/tmpFile > ${fullDir/tmpFile}.1;
mv ${fullDir/tmpFile}.1 $fullDir/tmpFile;
Shell_Perl_Introduce
投稿者 weijingli 時刻: 12/14/2007
ラベル: Linux
Subscribe to:
Post Comments (Atom)
0 コメント:
Post a Comment