#!/bin/bash
#替换this.Content中页码为实际的页码,此处为现有页码加U+Unix上的差值,P+Windows上的差值.
file=$1 #文件名称
maxNum=$2
minNum=$3
diff4U=$4
diff4P=$5
for pageNum in {$maxNum..$minNum}; #最大页码和最小页码
do
let pageNum4U=$pageNum+$diff4U
let pageNum4P=$pageNum+$diff4P
# Only 4 Windows
sed -i "s/\ $pageNum/\ P$pageNum4P/g" $file
# 4 Linux & Windows
sed -i "s/\ $pageNum/\ P${pageNum4P}\ U${pageNum4U}/g" $file
echo $pageNum4U
echo $pageNum4P
done
chmod 700 $1
时间: 2024-10-12 05:24:58