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:
Split the line and save file

 



rajarajankr
New User

Mar 2, 2007, 1:53 AM

Post #1 of 1 (2120 views)
Split the line and save file Can't Post

Hi all,

I write the script for multiple user account deletion initially what iam doing first open the users _delete file and username and save then I have to find out the servers details for usersname grep it and and take the only the server name and save it to systems_list file . but run the systems_list file is not saved .

please give ur valuable suggestions,

#!/usr/bin/perl
$line1= 0;
$MYFILE= "/home/rajrajan/tnp/test.txt";
open(MYFILE) or die("Could not open MYFILE file.");
foreach $line (<MYFILE>)
{

{

($name,$fullname,$nid,$tdate,$mgrnid,$mname) =
split(':',$line);
}

open(FH1, ">users_delete");
print FH1 "$name Y";
close(FH1);

@sline = `grep $name /home/monitor/files/*`;
foreach $sline (@sline)
{

($dummy,$server) = split /password./,$sline;
($server,$dummy) = split /:/,$server;


open (FH2, ">systems_list");
print FH2 "$server";

close (FH2);
}
system ("./propagate");
}
close(MYFILE);

 
 


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

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