Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Nov 2013 11:04:30 +0100
From:      Polytropon <freebsd@edvax.de>
To:        s m <sam.gh1986@gmail.com>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: how "more" and "less" work together?
Message-ID:  <20131124110430.5fe46515.freebsd@edvax.de>
In-Reply-To: <CAA_1SgF%2B3Bhi=h_Juv4O_e5y34CTFwqkt%2B41nEq3yG9E6VWKXA@mail.gmail.com>
References:  <CAA_1SgF%2B3Bhi=h_Juv4O_e5y34CTFwqkt%2B41nEq3yG9E6VWKXA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 24 Nov 2013 13:10:52 +0330, s m wrote:
> i have freebsd9.2 and want to customize "more" functionality but i can not
> find any code for it; therefore i change the "less" code.

Because "more is less", both executables are generated from
the same source code. In fact, those are the same binary,
hardlinked.

% which more less | xargs ls -l
-r-xr-xr-x  2 root  wheel  118788 Aug 21  2011 /usr/bin/less
-r-xr-xr-x  2 root  wheel  118788 Aug 21  2011 /usr/bin/more

So there is no separate source code for "more". Similarly,
zless, bzless, xzless, and lzless are "created". They're
all the same shell script, refering to /usr/bin/less.



> now my question is how more and less work together??

They don't. :-)



> i compiled my code and
> if i run less (which i change it) manually, it works fine, but more command
> doesn't use it. i put my less daemon is /usr/bin.

Make sure the hardlinks are created correctly. You can do that
with the "make install" command in the system's source tree
after applying your patch. See /usr/src/usr.bin/less/Makefile
for details.



> any body knows how can i apply my changes to more command?

Change the source code directly in the proper /usr/src subdirectory
or create a patch with a work copy. Then install it.



> how can i update
> more daemon (which is located in /usr/bin) in order to use the new less
> daemon?

As briefly explained. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131124110430.5fe46515.freebsd>