Date: Sat, 15 Apr 2017 18:00:29 -0400 From: Jim Trigg <jtrigg@huiekin.org> To: Ernie Luzar <luzar722@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: awk help Message-ID: <ED619733-BA35-47FC-8050-C10079DD7381@huiekin.org> In-Reply-To: <58F28697.4040803@gmail.com> References: <58F25A01.1060208@gmail.com> <7951DF71-5CD3-4B53-9CB4-13CAA8945983@huiekin.org> <58F28697.4040803@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
It's called a pattern, and it restricts the block to only be executed for records that match that pattern.
Jim
On April 15, 2017 4:46:15 PM EDT, Ernie Luzar <luzar722@gmail.com> wrote:
>
>>> On April 15, 2017 1:36:01 PM EDT, Ernie Luzar <luzar722@gmail.com>
>wrote:
>>> Hello list;
>>>
>>> Can not figure how to process 2 lines as a single line.
>>> I have this file.
>>>
>>> poollist: opts = 0x2
>>> Name: test Role: ipf References: 2 Hits: 0
>>> Nodes Starting at 0xc9fd4800
>>> Address: 1.11.244.65/32
>>> Hits 0 Bytes 0 Name Ref 2
>>> Address: 1.163.113.139/32
>>> Hits 0 Bytes 0 Name Ref 2
>>> Address: 1.163.139.214/32
>>> Hits 0 Bytes 0 Name Ref 2
>>> Address: 1.173.51.202/32
>>> Hits 0 Bytes 0 Name Ref 2
>>> Address: 1.175.164.129/32
>>> Hits 0 Bytes 0 Name Ref 2
>>> Address: 99.197.14.34/32
>>> Hits 0 Bytes 0 Name Ref 2
>>>
>>> The Address line and the Hits line makes a pair.
>>>
>>> For any pair that hits is greater than zero
>>> output file with ip address with ; sufix instead of /32 and
>>> hit value in fixed position.
>>>
>>> I can't figure out how to code awk to process the 2 lines as a pair.
>>>
>>> All ready searched the online awk references and could not find an
>>> example. Any pointers would sure help.
>>>
>>> Thanks
>> Jim Trigg wrote:
>> /^Address/ { address = $2; got_address = 1; }
>> /^ Hits/ { if (got_address) {
>> hits = $2;
>> if (hits) {
>> [Do what's needed with address and hits]
>> got_address = 0;
>> } else {
>> [Handle error condition of hits without
>address]
>> }
>> }
>>
>> Jim
>>
>
>In awk talk what is this called
>/^Address/
>/^ Hits/
>
>
>Thanks
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
From owner-freebsd-questions@freebsd.org Sat Apr 15 22:49:45 2017
Return-Path: <owner-freebsd-questions@freebsd.org>
Delivered-To: freebsd-questions@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
[IPv6:2001:1900:2254:206a::19:1])
by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FACAD3F38C
for <freebsd-questions@mailman.ysv.freebsd.org>;
Sat, 15 Apr 2017 22:49:45 +0000 (UTC)
(envelope-from dpchrist@holgerdanske.com)
Received: from holgerdanske.com (holgerdanske.com
[IPv6:2001:470:0:19b::b869:801b])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "holgerdanske.com", Issuer "holgerdanske.com" (not verified))
by mx1.freebsd.org (Postfix) with ESMTPS id 903001D9A
for <freebsd-questions@freebsd.org>; Sat, 15 Apr 2017 22:49:45 +0000 (UTC)
(envelope-from dpchrist@holgerdanske.com)
Received: from 99.100.19.101 ([99.100.19.101]) by holgerdanske.com with ESMTPSA
(ECDHE-RSA-AES128-GCM-SHA256:TLSv1.2:KxìDH:Au=RSA:Enc®SGCM(128):Mac®AD)
(SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN)
for <freebsd-questions@freebsd.org>; Sat, 15 Apr 2017 15:49:44 -0700
Subject: Re: Is it possible to install FreeBSD on a single MBR slice with ZFS ?
To: freebsd-questions@freebsd.org
References: <VI1PR02MB12004B1D8A87B3E247FC1A66F6040@VI1PR02MB1200.eurprd02.prod.outlook.com>
From: David Christensen <dpchrist@holgerdanske.com>
Message-ID: <e2f76fb0-05e0-5a53-1730-a5a64291c407@holgerdanske.com>
Date: Sat, 15 Apr 2017 15:50:39 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Icedove/45.6.0
MIME-Version: 1.0
In-Reply-To: <VI1PR02MB12004B1D8A87B3E247FC1A66F6040@VI1PR02MB1200.eurprd02.prod.outlook.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>,
<mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/>
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>,
<mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 15 Apr 2017 22:49:45 -0000
On 04/15/2017 02:55 AM, Manish Jain wrote:
> I always use freebsd-ufs for my installations. But I am interested in
> trying freebsd-zfs. My box has a single hard disk, an SSD with 4 MBR slices.
>
> From what I could gather from the installer, it is not possible to use
> freebsd-zfs for / for a single slice. It looks to me like ZFS needs the
> whole disk.
>
> Am I wrong ? Is there any way I can get the installer to use ZFS for a
> single slice.
AFAIK, the FreeBSD 11.0 installer wants the whole disk if I choose:
Partitioning Auto (ZFS)
My solution was to buy a 16 GB SSD. Once installed, I moved the image
onto a larger drive. This seems to work with just a basic install.
(Previous attempts to move an image with Xfce resulted in broken Xfce.)
David
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ED619733-BA35-47FC-8050-C10079DD7381>
