📄 incbuild.plx
字号:
#!D:\perl\bin -w
######################################################################
#
# File: incbuild file
# Purpose: Script to increment BRD_BUILD variable
#
######################################################################
die "must enter a filename: $!" unless @ARGV;
$_ = $ARGV[0];
my($old, $new, $line, $build) = ("$_", "$_.tmp");
die "file must be a text file" unless -T; # return if not a text file
open(OLD, "< $old") || die "can't open $old: $!";
open(NEW, "> $new") || die "can't open $new: $!";
binmode( OLD );
binmode( NEW );
while (<OLD>) {
if (/BRD_BUILD/)
{
/(\d+)/; # grab the current build number
$build = $1 + 1; # increment it
s/\d+/$build/; # and substitute it back in
}
print NEW $_ || die "can't write to $new: $!";
}
close(OLD);
close(NEW);
rename($new,$old) || die "can't rename $new to $old: $!";
print "BRD_BUILD = $build\n";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -