If your file really looks like that and you're really only
trying to print the first column just:
cut -d' ' -f1 < your.file
from the command prompt.
or if you want the dns server name instead:
tr -s '[:blank:]' '\t' < cu.txt | cut -f2
-will
Tyler Longren wrote:
>
> Hello everyone,
>
> I have a file that contains a few domain names, and their dns servers (kind
> of like a zonefile). Here's the format:
> my.com dns1.blah.com
> me.com dns1.blah.com
> we.com dns1.blah.com
> you.com dns1.blah.com
>
> How can I get ONLY the domain's out of that file, and print each domain to
> the screen. I used this to search through httpd.conf once:
> open(APACHE_CONF, "/usr/local/apache/conf/httpd.conf") or die "Could not
> open Apache config file:\n$!\n";
> my @servernames;
> while(<APACHE_CONF>) {
> push (@servernames, $1)
> if/ServerName\swww.(.*)/;
> }
>
> Can anyone help me?
>
> Thanks once again,
> Tyler
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]