From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from minnie.tuhs.org (minnie.tuhs.org [50.116.15.146]) by inbox.vuxu.org (Postfix) with ESMTP id A5996243ED for ; Thu, 20 Jun 2024 01:22:06 +0200 (CEST) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id E311A43BBC; Thu, 20 Jun 2024 09:21:58 +1000 (AEST) Received: from fhigh4-smtp.messagingengine.com (fhigh4-smtp.messagingengine.com [103.168.172.155]) by minnie.tuhs.org (Postfix) with ESMTPS id B952243BB5 for ; Thu, 20 Jun 2024 09:21:51 +1000 (AEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 924E91140150; Wed, 19 Jun 2024 19:21:50 -0400 (EDT) Received: from imap45 ([10.202.2.95]) by compute5.internal (MEProxy); Wed, 19 Jun 2024 19:21:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1718839310; x=1718925710; bh=qjEG5Zo079 xKdgCpENeg8CfV4ScC1bSydCf91YRxJr8=; b=BJoNTAKHF7PKIIyr8W/dkOgR3H Ft5072qvnVLzkuwYGGja61h2H5yiymjoseorFEKfGW5OwLjBo2+u7WeQtkHSdypH 6DEfy6/q8DnjdOGu8DIzHfUv+f5/ShwKlS3VxKbA24xihrq9VZda9NFu3/ipktA4 b4+NZvQIrbCLxiJOHBHvhLcc6XI8jJ+RWgr7chvNh8DsKGiltr8pSyfeH0VtZgpM sx653j2GyxurKfL7ilh4CWGAYfpTHagQUEEHzwwcvJTeWW6FxNuIBfR3qtqdgu9y Tl8e9NgjSxHtgiDjVJ6Nmr/NoFqcilUALSIjyYNVH+vhDzPkSi2SIaZ97ROg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1718839310; x=1718925710; bh=qjEG5Zo079xKdgCpENeg8CfV4ScC 1bSydCf91YRxJr8=; b=B5lJ14HJbNJuWJbGcneCbDKFnFGmFqRdhszNy6tVuxG8 o1z3KFmE8xhLk+dVejtPETGx+VO/1OPoap9lumbD66yOKRHWxEptBMztaEgIIp7F SVbxBtSqbzijkBacvUfuKB++bx91cRRe01gT3N5bXoxpQF1aiNfcmbH0aRcExRm/ PJMwg0I0XSvIlPpk7zk3+uiQg4vqpGoe/OChN/RwsCXecMhhD3lt8OJ1aEhWW7is zcHcNVeVaS2vHhSZcNethga7lajkHbqXoceGO3846wC0ltmUYPdjNdjQegvRfcxF s5Fh+dgDVN/9ELeuKBeIMShX9c9sZ23md6AXT5tNdQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeefuddgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetlhgr nhcuffdrucfurghlvgifshhkihdfuceorggushesshgrlhgvfihskhhirdgvmhgrihhlqe enucggtffrrghtthgvrhhnpedtveekgedvhfdvheehkefhffeffeegkedvjeegvdegteei keejheegleeuveeigeenucffohhmrghinheptggrthgsrdhorhhgpdhgihhtlhgrsgdrtg homhdpghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprggushesshgrlhgvfihskhhirdgvmhgrihhl X-ME-Proxy: Feedback-ID: if9414728:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 37DBD272007C; Wed, 19 Jun 2024 19:21:50 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-522-ga39cca1d5-fm-20240610.002-ga39cca1d MIME-Version: 1.0 Message-Id: In-Reply-To: <20240516195309.GB287325@mit.edu> References: <20240516195309.GB287325@mit.edu> Date: Wed, 19 Jun 2024 19:20:24 -0400 From: "Alan D. Salewski" To: "TUHS (The Unix Heritage Society)" Content-Type: text/plain Message-ID-Hash: 7UTFDPWCNOZR7BXKSM22BQ47QTLZUYBA X-Message-ID-Hash: 7UTFDPWCNOZR7BXKSM22BQ47QTLZUYBA X-MailFrom: ads@salewski.email X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: Be there a "remote diff" utility? List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, May 16, 2024, at 15:53, Theodore Ts'o wrote: > On Thu, May 16, 2024 at 04:34:54PM +1000, Dave Horsfall wrote: >> Every so often I want to compare files on remote machines, but all I can >> do is to fetch them first (usually into /tmp); I'd like to do something >> like: >> >> rdiff host1:file1 host2:file2 >> >> Breathes there such a beast? I see that Penguin/OS has already taken >> "rdiff" which doesn't seem to do what I want. [...] > In any case, the way I'd suggest that you do this that works as an > extention to the Unix philosohy of "Everything looks like a file" is > to use FUSE: > > sshfs host1:/ ~/mnt/host1 > sshfs host2:/ ~/mnt/host2 > diff ~/mnt/host1/file1 ~/mnt/host2/file2 > > Cheers, > > - Ted Mentioning this since I just came across it today: Eric S. Raymond (ESR) has a 'netdiff' tool available here: http://www.catb.org/~esr/netdiff/ https://gitlab.com/esr/netdiff Perform diff across network links. Takes two arguments which may be host:path pairs in the style of ssh/scp, make temporary local copies as needed, applies diff(1). All options are passed to diff(1). Usage: netdiff [diff-options] [host1:]path1 [host2:]path2 It's 56 lines of POSIX shell script that invokes 'scp' behind the scenes and creates temp files that are fed to 'diff', with some file name post-processing. Compared to the one line of shell script mentioned by Arnold: diff -u <(ssh host1 cat file1) <(ssh host2 cat file2) the main benefits I see to 'netdiff' in its current form are that it encapsulates the mechanism behind a descriptive name that can be found in the file system, and it has a man page. So it can be found, used and/or studied by those with larval shell fu. However, the comments in the 'netdiff' source suggest openness to supporting different transport mechanisms, which (if added) might allow using the same command line interface regardless of the underlying transport being used (scp, ssh, rsync, curl, wget, whatever), possibly with different transports for each of the requested files. Of course, that would not offer a superior user experience to the '9import', 'sshfs', and NFS approaches also mentioned. But if there were an 'rf' ("remote file") tool that did just the transport abstraction portion, then tools such as 'netdiff' could use it internally, or folks could use it directly: diff -u <(rf user@host1:/path/to/file1) <(rf user@host2:/path/to/file2) The presumption here is that the user has control over some local configuration that maps user@host pairs to transports (maybe defaulting to 'ssh' invoking 'cat' on the remote host). Maybe somebody who needs more than 'ssh' would find value in such a thing... -Al -- a l a n d. s a l e w s k i ads@salewski.email salewski@att.net https://github.com/salewski