CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
Find/replace to new file

 



Naresh
New User

May 15, 2008, 11:41 PM

Post #1 of 2 (2159 views)
Find/replace to new file Can't Post



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?


KevinR
Veteran


May 15, 2008, 11:45 PM

Post #2 of 2 (2158 views)
Re: [Naresh] Find/replace to new file [In reply to] Can't Post

ask on www.unix.com in the 'shell scripting forum', there are a number of people with experience in various shell scripts that can do the translation from korn to perl for you.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives