Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Replace an asterisk '*" with the content of array

by deep27ak (Novice)
on Sep 19, 2015 at 05:54 UTC ( [id://1142488]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Replace an asterisk '*" with the content of array
in thread Replace an asterisk '*" with the content of array

Thanks for looking into my script, I got it was I was looking for, the script was good with few mistakes but the main problem was that my array was treating the complete list of ip and subnets as 1 element so had to split them and everything worked out fine

final script
my @finalnwlist = split (/\n/, join (' ', @networklist, @brnwlist, @vn +wlist)); my @entries; sub update_exports { my $exports = 'exports'; open (EXPORTS,"<exports") ||die "Error opening exports file"; my @lines = <EXPORTS>; close (EXPORTS); open (TMP_EXP, ">> exports_tmp") || die "File not found"; foreach $a (@lines) { if ( $a =~ m/\*/) { logmsg "Generating unrestricted entry.."; my ($share, $permission) = split (/\*/, $a); for my $b (@finalnwlist) { @entries = join ('', $share, $b, $permission) +; print TMP_EXP @entries; } } else { print TMP_EXP $a; } } close(TMP_EXP); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1142488]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 06:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found