Bash 使用 sdiff 比较来自两个远程 url 的内容的脚本

Bash Script using sdiff to compare content from two remote urls

我正在尝试使用一个简单的 bash 命令来引起两个 curl 请求的差异

$ sdiff -l -w 140 $(curl -s "https:/URL/1/2/thing.php?d=20190202") \
                  $(curl -s "https:/URL/1/2/thing.php?d=20190203")

如果我将这两个 curl 请求下载到文件中,然后比较它的文件。是否可以合并为一个命令?

您可以使用 process substitution:

sdiff ... <(curl ...) <(curl ...)