Search code examples
pythonbeyondcomparebeyondcompare4

BeyondCompare - How to generate compare report in command line?


I'm using BeyondCompare 4 on Linux, and my goal is to generate a compare result from command line and then use this result in python or some other scripts.

I have tried to use bcompare @"script.txt" file1 file2 result.txt. Which script.txt is:

file-report layout:side-by-side output-to:%3 %1 %2

But the result's format is difficult to parse with other scripts.

Question: How could I generate two texts like the ones showing in BeyondCompare's GUI?


Solution

  • The script appears to be correct, but Beyond Compare on Linux requires an X-Window session to run, even for a script. This means it will fail to launch if you run a script in an SSH terminal without an X-Window client configured or if you run it as a cron job.

    Beyond Compare on macOS has a similar GUI requirement for scripts.

    Beyond Compare on Windows isn't dependent on a GUI for scripts, so it will run as a scheduled task without a user logged on.

    Removing the X-Window/GUI dependency for Beyond Compare scripts on Linux and macOS is on the todo list.