User Profile

Collapse

Profile Sidebar

Collapse
blackice
blackice
Last Activity: Nov 19 '07, 09:06 AM
Joined: Oct 4 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • so thanks for your wonderful answers so if the file was messy or something i mean if before the script running the file looks like this

    zone "blah.com" {
    xxxx
    xxxx
    xxxx
    }


    zone "bar.com" {
    xxxx
    xxxx
    xxxxx
    xxxxx
    }

    notice that the file has already 2 blank lines . so how i can make the script to edit to make the file...
    See more | Go to post

    Leave a comment:


  • Many Thanks it works fine but kindly can you show me how that works ?
    i mean can u illustrate the code meaning for me ?

    i donot know what is the MAINLOOP and also teh $^I and i will be thankful
    See more | Go to post

    Leave a comment:


  • After deleting lines from a file i need to keep the file order

    Hello All,

    i have a Perl Script that deleting Zones from named.conf file and here is the script
    [CODE=perl]#!/usr/bin/perl -w

    use strict;

    print "please enter the domain name: ";

    chomp (my $targetdomain = <STDIN>);

    my $file = "/home/adam/Desktop/hello"; # copied to my home folder

    rename $file, "$file.bak" or die "Can't...
    See more | Go to post
    Last edited by eWish; Nov 13 '07, 03:27 AM. Reason: Added Language To Code Tag

  • thanks it works thanks for your great support :)
    See more | Go to post

    Leave a comment:


  • yes i need

    i want to improve this script to not just comment a fixed length of the lines but i want to make it global so i asked in forums and i got that script that works wonderfully well .,

    Code:
    #!/usr/bin/perl -w
    
    use strict;
    
    print " please enter the domain name: ";
    
    my  $targetdomain = <STDIN>;
    
    chomp $targetdomain;
    
    my  $file = "/home/blackice/hello";
    ...
    See more | Go to post

    Leave a comment:


  • i have done someting which is a condition if it find the }; it will break but the break didnot work and it had an error

    [code=perl]
    #!/usr/bin/perl -w

    use strict;

    print " please enter the domain name: ";

    my $targetdomain = <STDIN>;

    chomp $targetdomain;

    my $file = "/home/adam/Desktop/hello";


    open...
    See more | Go to post
    Last edited by numberwhun; Oct 9 '07, 11:39 AM. Reason: add code tags

    Leave a comment:


  • The script is working well but i need to improve itis function .

    hello all ...,

    first i would thank all the people who are in this forums cause they are very helpful ...,

    By the way i had some posts hers about comment out the named.conf file the script is simply comment out the zones in the file and it works well

    while i was testing scrpt i found that the script is working in an fixed way which means that the zone must be 5 lines if it not a five line the script...
    See more | Go to post

  • thanks soOooOOOOOooooo oOOOOooooOOO much
    See more | Go to post

    Leave a comment:


  • thanks it works and better than i created
    but could you kindly explain me the mechanism of this code and what is Fcntl ':flock'; and how it works i want more explain cause this types of code will help me alot in editing various type of linux files .

    and thanks again too much ....
    ------------------------------------------------------------------------------------------------

    back to my code i did some...
    See more | Go to post

    Leave a comment:


  • aha i need solution
    i think iam now very close to the right solution ..

    here is the code :-

    Code:
    #!/usr/bin/perl -w 
    
    use strict;
    
    print " please enter the domain name: ";
    
    my  $targetdomain = <STDIN>;
    
    chomp $targetdomain;
    
    my  $file = "/home/blackice/hello";
    
    open HAN,$file || die "error opening file:
    ...
    See more | Go to post

    Leave a comment:


  • thanks for your support

    but what about if i want to after searching comments the empty line before the zone name and comment five lines after commenting the empty line before the zone
    See more | Go to post

    Leave a comment:


  • sorry for that ....,


    I want to write a perl script which will comment out a domain in my named.conf file for Bind.

    as a test i made a file in my home directory to perform tests on it ...

    the file is /home/blackice/hello

    and i wrote this script

    Code:
      #!/usr/bin/perl -w 
    
    use strict;
    
    print " please enter the domain name: ";
    ...
    See more | Go to post

    Leave a comment:


  • blackice
    started a topic NEED HELP IN Search comment lines Perl script
    in Perl

    NEED HELP IN Search comment lines Perl script

    Hello all

    this thread ihttp://www.thescripts. com/forum/thread50290.htm l contains what i need but i cannot understand some of the code i need more explain ....


    Code:
    my $sampleinput = <<"EOF";
    
    zone "dontchangethisdomain.com" {
    type master;
    file "/somepath/to/dontchangethisdomain.com";
    notify yes;
    }
    
    zone "mydomain.com"
    ...
    See more | Go to post
No activity results to display
Show More
Working...