Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jan 2017 11:30:32 -0800
From:      David Christensen <dpchrist@holgerdanske.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 11.0-RELEASE-p7 i386 system drive imaging and migration
Message-ID:  <b545887a-71f1-c218-c572-7e904ca5a485@holgerdanske.com>
In-Reply-To: <alpine.BSF.2.20.1701300816340.85129@wonkity.com>
References:  <df0c81d7-fd2b-852f-4007-5fb4b24100e0@holgerdanske.com> <alpine.BSF.2.20.1701290622500.13432@wonkity.com> <516b147d-6faa-b9c0-1d8f-2313a0755211@holgerdanske.com> <alpine.BSF.2.20.1701292206450.71961@wonkity.com> <3f6c8bfb-70a4-74c2-3879-b328ecd3bb38@holgerdanske.com> <alpine.BSF.2.20.1701300816340.85129@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 01/30/17 07:27, Warren Block wrote:
> On Sun, 29 Jan 2017, David Christensen wrote:
>
>> On 01/29/17 21:18, Warren Block wrote:
>>> On Sun, 29 Jan 2017, David Christensen wrote:
>>>
>>>> On 01/29/17 05:27, Warren Block wrote:
>>>>> On Sat, 28 Jan 2017, David Christensen wrote:
>> I manually selected MBR partitioning scheme in the installer, as  I
>> have machines going back to Pentium 4's and I want something that will
>> work on all of them.
>
> GPT will work on them, that is part of the function of the PMBR.

Okay.  Maybe next time.


>>> setenv PAGER less
>>> man rc.conf
>>> Type
>>>   /ifconfig_DEFAULT
>>> and press Enter.
>>
>> Yes, I tried that.  Interactive use:
>>
>> Pattern not found (press RETURN)
>
> It is case sensitive.  Otherwise, don't know, it is found here.

My bad.  Fix:

dpchrist@freebsd:/usr/home/dpchrist/home $ cvs diff 
        Index: .profile
===================================================================
RCS file: /cvs/dpchrist/home/.profile,v
retrieving revision 1.5
diff -r1.5 .profile
6c6
< export PAGER=less;
---
 > export PAGER='less -I';
Index: .shrc
===================================================================
RCS file: /cvs/dpchrist/home/.shrc,v
retrieving revision 1.2
diff -r1.2 .shrc
8a9
 > alias less='less -I'


>> grep'ing the man page:
>>
>> dpchrist@freebsd:/usr/home/dpchrist $ man rc.conf | grep ifconfig_DEFAULT
>> <nothing>
>
> Sure, there are control characters mixed in with the output. Easier to
> search in the pager, but this will work:
>
>   man rc.conf | col -b | grep ifconfig_DEFAULT

Okay.


'man' is interleaving control characters to underline 'ifconfig_D' when 
output is to STDOUT or to $PAGER:

dpchrist@freebsd:/usr/home/dpchrist $ man rc.conf | egrep 
'i..f..c..o..n..f..i..g.._..D'| dump
00000000  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | 
     |
00000010  20 76 61 72 69 61 62 6c  65 20 5f 08 69 5f 08 66  | variable 
_.i_.f|
00000020  5f 08 63 5f 08 6f 5f 08  6e 5f 08 66 5f 08 69 5f 
|_.c_.o_.n_.f_.i_|
00000030  08 67 5f 08 5f 5f 08 44  5f 08 45 5f 08 46 5f 08 
|.g_.__.D_.E_.F_.|
00000040  41 5f 08 55 5f 08 4c 5f  08 54 20 6d 61 79 20 62  |A_.U_.L_.T 
may b|
00000050  65 20 63 6f 6e 66 69 67  75 72 65 64 2e 20 20 49  |e 
configured.  I|
00000060  74 20 77 69 6c 6c 20 62  65 20 75 73 65 64 0a     |t will be 
used.|
0000006f


'col -b' converts char1-backspace-char2 sequences to char2:

dpchrist@freebsd:/usr/home/dpchrist $ man rc.conf | col -b | egrep 
'ifconfig_D'| dump
00000000  09 09 20 76 61 72 69 61  62 6c 65 20 69 66 63 6f  |.. variable 
ifco|
00000010  6e 66 69 67 5f 44 45 46  41 55 4c 54 20 6d 61 79 
|nfig_DEFAULT may|
00000020  20 62 65 20 63 6f 6e 66  69 67 75 72 65 64 2e 20  | be 
configured. |
00000030  20 49 74 20 77 69 6c 6c  20 62 65 20 75 73 65 64  | It will be 
used|
00000040  0a                                                |.|
00000041


Is there a way (environment variable, alias) to filter 'man' output 
through 'col -b' when output is to STDOUT (rather than $PAGER)?


David




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b545887a-71f1-c218-c572-7e904ca5a485>