Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Curl 为什么在检查文件的sha256sum时会得到两个不同的结果?_Curl_Wget_Checksum - Fatal编程技术网

Curl 为什么在检查文件的sha256sum时会得到两个不同的结果?

Curl 为什么在检查文件的sha256sum时会得到两个不同的结果?,curl,wget,checksum,Curl,Wget,Checksum,我正在尝试获取下载文件的校验和,以便确保从ansible playbook正确部署该文件。我发现,根据我是先下载文件,还是通过带有curl的管道检查文件,我会得到两种不同的结果 下载并检查: $ wget https://github.com/drush-ops/drush/releases/download/8.1.15/drush.phar $ sha256sum drush.phar 6999d72e51577b1e20cfaec87152d9905b714f5812861692877b

我正在尝试获取下载文件的校验和,以便确保从ansible playbook正确部署该文件。我发现,根据我是先下载文件,还是通过带有curl的管道检查文件,我会得到两种不同的结果

下载并检查:

$ wget https://github.com/drush-ops/drush/releases/download/8.1.15/drush.phar
$ sha256sum drush.phar 
6999d72e51577b1e20cfaec87152d9905b714f5812861692877b8424a4e2358a  drush.phar
从卷曲处检查管道:

$ curl -s https://github.com/drush-ops/drush/releases/download/8.1.15/drush.phar| sha256sum
c703007cf15cbabbeb510031ded52e7482f85dd3cce037bf9bcb7d7749acaa23  -
你会认为他们会得到同样的结果吗?

谜团解开了

原始URL有重定向,我需要告诉
curl
跟随
-L
开关:

$ curl -sL https://github.com/drush-ops/drush/releases/download/8.1.15/drush.phar| sha256sum
6999d72e51577b1e20cfaec87152d9905b714f5812861692877b8424a4e2358a  -
瞧。现在校验和匹配