From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.lisp.guile.user Subject: Re: system command output different in guile than on command line Date: Wed, 5 Aug 2020 09:47:09 +0200 Message-ID: <20200805074709.GA27513@tuxteam.de> References: <1155809260.1393834.1596576862334.ref@mail.yahoo.com> <1155809260.1393834.1596576862334@mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2390"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Aug 05 09:47:33 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3E96-0000W2-1M for guile-user@m.gmane-mx.org; Wed, 05 Aug 2020 09:47:32 +0200 Original-Received: from localhost ([::1]:52586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3E94-0004GV-V0 for guile-user@m.gmane-mx.org; Wed, 05 Aug 2020 03:47:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3E8u-0004GH-HP for guile-user@gnu.org; Wed, 05 Aug 2020 03:47:20 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:36992) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1k3E8s-0001iB-Hc for guile-user@gnu.org; Wed, 05 Aug 2020 03:47:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=rtOjy+8D2woLbujY37zGjBibKRFokP05VnfXUmMFyss=; b=Nx0q0S4fftmvz0rM/znHW19At9uMbLL+rArf0XClNwlcA3JOdSX8/uN9qh0eCRuJtEbf/eTEllJl0UOcbeHgvHNOAlC903h8BOpycYF5IgNykANY6xnV1rGYf8Zw28JpfqHISHD3aNrqCYbcO/L6oemNPpT3EHlq+mVW4lF9UrN24NkieRmDkOMA47lML6IsohTHFqhTOtfSmxHjYozy2W5jfQn3+r0xb5btdUdKNnoAeax9gULIqCnIFZXoBVoWt/2X/dx0RLbaWvXMPYIceyONLS62yxSwhKdvfBX/26lLmW3hDlPmFUQ+tRptW1nv+EgoyOTExYTw1z/zY6uMgw==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1k3E8j-0007Hu-Iy for guile-user@gnu.org; Wed, 05 Aug 2020 09:47:09 +0200 Content-Disposition: inline In-Reply-To: <1155809260.1393834.1596576862334@mail.yahoo.com> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/05 03:47:10 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16776 Archived-At: --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 04, 2020 at 09:34:22PM +0000, vapnik spaknik wrote: > Hi, > I'm trying to write some code to get the size of a diff of two files. > If I run the following pipeline in my zsh shell: >=20 > > diff -ua /tmp/file1 /tmp/file2 | wc -c >=20 > it prints 215 > However when I run the following in guile: >=20 > guile> (system "diff -ua /tmp/file1 /tmp/file2 | wc -c") Have you actually tried to compare both results? There are a couple of things which could make a difference. The one which first comes to mind would be different environments (PATH, language settings in LANG, LC_). One thing you might want to try (to keep most of your experimental setup) would be: diff -ua /tmp/file1 /tmp/file2 > /tmp/delta1 and then guile> (system "diff -ua /tmp/file1 /tmp/file2 > /tmp/delta2") =2E..and then diff the diffs. Cheers -- t --6c2NcOVqGQ03X4Wi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAl8qY/0ACgkQBcgs9XrR2kamtACdG18bCyeKCCkcymjY7XvYfIcO WbYAnR7UuEKWEzZFLHTKNTL3HQEaAou/ =qucq -----END PGP SIGNATURE----- --6c2NcOVqGQ03X4Wi--