From owner-freebsd-questions@FreeBSD.ORG Sun Nov 24 10:04:52 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83D70BE3 for ; Sun, 24 Nov 2013 10:04:52 +0000 (UTC) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A89029EC for ; Sun, 24 Nov 2013 10:04:51 +0000 (UTC) Received: from r56.edvax.de (port-92-195-106-241.dynamic.qsc.de [92.195.106.241]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id F35F3278E0; Sun, 24 Nov 2013 11:04:43 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id rAOA4UgE006516; Sun, 24 Nov 2013 11:04:30 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sun, 24 Nov 2013 11:04:30 +0100 From: Polytropon To: s m Subject: Re: how "more" and "less" work together? Message-Id: <20131124110430.5fe46515.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Nov 2013 10:04:52 -0000 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, ...