This is a discussion on awk - Removing domain name entires within the Shell scripting forums, part of the Development/Scripting category; Hello, I am new to shell scripting. I want to optimize my one of the script. I have one file ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
Hello,
I am new to shell scripting. I want to optimize my one of the script. I have one file and i want to remove selected zones for domains from that file.In this file i have almost 3500 zones for domains.Sample data for the file.... named.backup ------------------------------------------------------------- zone "britshoponline.co.uk" { type master; file "/var/named/britshoponline.co.uk.db"; }; zone "skateboardstickers.net" { type master; file "/var/named/skateboardstickers.net.db"; }; zone "kalibrantas.or.id" { type master; file "/var/named/kalibrantas.or.id.db"; }; zone "mf-host.com" { type master; file "/var/named/mf-host.com.db"; }; zone "googlepatch.com" { type master; file "/var/named/googlepatch.com.db"; }; -------------------------------------------------------- list.conf contains 2 records.. vebosoft.com kalibrantas.or.id --------------------------------------------------------- AWK script (namedscript.awk) .. BEGIN{ } { zone = $1 sedcmd = "sed '/" zone "/,+4d' named.backup > named.backup.test" printf "Command: %s\n", sedcmd system(sedcmd) system("mv named.backup.test named.backup") } END{ } -------------------------------------------------------------- My command for executing the script: awk -f namedscript.awk list.conf -------------------------------------------------------------- In the above code it's possible to remove "system("mv named.backup.test named.backup")" command. But i dont; know i how to do it. Please help me.. Thanks in Advance |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell Script for adding, removing and commiting the SVN (Subversion system ) | anilvrathod | Shell scripting | 0 | 12-07-2007 05:40 PM |
| Masquerade domain sendmail how to | chiku | Mail Servers | 2 | 07-10-2007 08:20 AM |
| Removing useless users in CentOS | meowing | Web servers | 3 | 05-15-2007 12:43 PM |
| Shell scripting - Removing file extension | urbanreformer | Shell scripting | 3 | 03-07-2007 08:44 PM |
| removing a -- directory | ricc | Linux software | 2 | 06-10-2006 08:40 AM |