I have korn shell script that genretaets 100 file based on template replacing the number.
The template file is as below:
Code:
$ cat template
file number: NUMBER
The shell script is as below:
Code:
$ cat gen.sh
#!/bin/ksh
i=1;
while ((i <= 100)); do
sed "s/NUMBER/$i/" template > file_${i}
(( i = i + 1));
done
Now I want to migrate this code into perl script called gen.pl
How can I fine replace NUMBER is template file and generate new output file?