[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: system command output different in guile than on command line
From: |
tomas |
Subject: |
Re: system command output different in guile than on command line |
Date: |
Wed, 5 Aug 2020 09:47:09 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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:
>
> > diff -ua /tmp/file1 /tmp/file2 | wc -c
>
> it prints 215
> However when I run the following in guile:
>
> 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")
...and then diff the diffs.
Cheers
-- t
signature.asc
Description: Digital signature