如何将输入从标准输入传递给 gsutil cp?
How to pipe input to gsutil cp from stdin?
我正在寻找一种将数据通过管道传输到 gsutil cp 的方法:
echo '<html>foobar</html>' | gsutil cp --stdin gs://my-bucket/foo
-I
选项用于读取文件路径,而不是数据。gsutil help cp
说:
https://gist.github.com/ORESoftware/566d9c3d00e3858c1161ae9b741fc07e
是的,我正在寻找一种通过标准输入将文件发送到 GS 的方法。
看起来像这样使用 -
可以工作:
echo '<html>foobar</html>' | gsutil cp - gs://my-bucket/foo
在我看来,--stdin
标志会更明确和更受欢迎。
我正在寻找一种将数据通过管道传输到 gsutil cp 的方法:
echo '<html>foobar</html>' | gsutil cp --stdin gs://my-bucket/foo
-I
选项用于读取文件路径,而不是数据。gsutil help cp
说:
https://gist.github.com/ORESoftware/566d9c3d00e3858c1161ae9b741fc07e
是的,我正在寻找一种通过标准输入将文件发送到 GS 的方法。
看起来像这样使用 -
可以工作:
echo '<html>foobar</html>' | gsutil cp - gs://my-bucket/foo
在我看来,--stdin
标志会更明确和更受欢迎。