From owner-freebsd-questions@freebsd.org Mon Nov 2 21:24:10 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DBDC45B1E6 for ; Mon, 2 Nov 2020 21:24:10 +0000 (UTC) (envelope-from ralf-mardorf@riseup.net) Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CQ5Wr5d3kz421w for ; Mon, 2 Nov 2020 21:24:08 +0000 (UTC) (envelope-from ralf-mardorf@riseup.net) Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4CQ5Wl2c05zFtML for ; Mon, 2 Nov 2020 13:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1604352243; bh=cQRQl9lDEx2tW5rlfuEm2zKaQaIHvwfnwvTGza25aRc=; h=Date:From:To:Subject:In-Reply-To:References:From; b=j0PnVOjz+LTTKkDBxKVWW/4D8/FRo92dBXynep7OwAy8pzbG/dQuL4RiL6lEKWd9o pGTdGg1elNsPBotFB0jLR/w18UP4lEUTepIncSAZjiFjA6Fh0CJrlKKN7rVKVT91Ld 0epmSIOy3x3JoqGsfKG6VfQauISapzNsxWXiztUY= X-Riseup-User-ID: 56E27E9F5031C266F29A397A9A495155447E44C93A33A905A03B76E6ACA31037 Received: from [127.0.0.1] (localhost [127.0.0.1]) by bell.riseup.net (Postfix) with ESMTPSA id 4CQ5Wk5QngzJmgP for ; Mon, 2 Nov 2020 13:24:02 -0800 (PST) Date: Mon, 2 Nov 2020 22:23:56 +0100 From: Ralf Mardorf To: freebsd-questions@freebsd.org Subject: Re: simple shell script to compare two dirs recursively Message-ID: <20201102222356.7052911a@archlinux> In-Reply-To: <20201102220603.3b69f35c@archlinux> References: <34dfc85a-b985-e31f-a6b2-cf14f1f56fd2@nethead.se> <20201102220603.3b69f35c@archlinux> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4CQ5Wr5d3kz421w X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=riseup.net header.s=squak header.b=j0PnVOjz; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (mx1.freebsd.org: domain of ralf-mardorf@riseup.net designates 198.252.153.129 as permitted sender) smtp.mailfrom=ralf-mardorf@riseup.net X-Spamd-Result: default: False [-4.24 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[riseup.net:s=squak]; NEURAL_HAM_MEDIUM(-1.08)[-1.080]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[198.252.153.129:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[riseup.net:dkim]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[riseup.net:+]; DMARC_POLICY_ALLOW(-0.50)[riseup.net,none]; NEURAL_HAM_SHORT(-0.57)[-0.573]; NEURAL_HAM_LONG(-0.99)[-0.990]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:16652, ipnet:198.252.153.0/24, country:US]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions]; RCVD_IN_DNSWL_LOW(-0.10)[198.252.153.129:from] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2020 21:24:10 -0000 On Mon, 2 Nov 2020 22:06:03 +0100, Ralf Mardorf wrote: >On Mon, 2 Nov 2020 19:45:42 +0000 (UTC), doug wrote: >>then awk is your best friend > >I seriously doubt that diff in combination with awk is a friend, if the >premiss is... > >On Mon, 2 Nov 2020 19:11:41 +0100, Per olof Ljungmark wrote: >>I could *probably* cook this myself with some time and patience, but >>now it is somewhat urgent, so if someone likes to share their already >>working solution I would be most grateful. > >...unless you already know what to do. > >IIUC the OP is asking for a script ruling out pitfalls of "simple" diff >+ whatsover usage, without a time consuming learning curve. > >I don't have got the skills to provide a solution, since I'm aware of >at least a few possible pitfalls. > >It might be helpful to know what paths should be compared, resp. what >the possible contend of those paths (most likely) is. For example, do you want to compare a source and a backup made by a copy command? https://www.freebsd.org/cgi/man.cgi?cp "-H If the -R option is specified, symbolic links on the command line are followed. (Symbolic links encountered in the tree traversal are not followed.) -L If the -R option is specified, all symbolic links are followed. -P If the -R option is specified, no symbolic links are followed. This is the default."