forked from alhazred/solaris-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenerateNOs.pl
49 lines (38 loc) · 1.24 KB
/
GenerateNOs.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/local/bin/perl
# To Generate Nos with specified extension - Vinoth - [email protected]
# Change above perl path as per your installation.
if ( ! $ARGV[0] || ! $ARGV[1] ) {
print "\nUsage: GenerateNOs.pl <firstnum> <Count> [extension]\n\n";
exit(0);
}
if ( ! $ARGV[2] ){
$ext="";
}else{
$ext=".$ARGV[2]";
}
$i=0;
$St1="";
$St2="";
$START=$ARGV[0];
if ( $START =~ /^(.*?)(\d+)$/ ){
$St1 = $1;
$St2 = $2;
for ( $i = 0; $i < $ARGV[1] ; $i++ ) {
print $St1 . $St2++ . "$ext\n";
}
} else {
for ( $i = 0; $i < $ARGV[1] ; $i++ ) {
print $START++ . "$ext\n";
}
}
##############################################################################
### This script is submitted to BigAdmin by a user of the BigAdmin community.
### Sun Microsystems, Inc. is not responsible for the
### contents or the code enclosed.
###
###
### Copyright 2006 Sun Microsystems, Inc. ALL RIGHTS RESERVED
### Use of this software is authorized pursuant to the
### terms of the license found at
### http://www.sun.com/bigadmin/common/berkeley_license.html
##############################################################################