如何将输入从stdin传递到gsutil cp?

问题描述 投票:0回答:1

我正在寻找一种将数据传输到gsutil cp中的方法:

echo '<html>foobar</html>' | gsutil cp --stdin gs://my-bucket/foo

-I选项用于读取文件路径,而不是数据。gsutil help cp说:

https://gist.github.com/ORESoftware/566d9c3d00e3858c1161ae9b741fc07e

是的,我正在寻找一种通过stdin将文件发送到GS的方法。

google-cloud-storage gcloud gsutil
1个回答
0
投票

看起来像使用-一样起作用:

echo '<html>foobar</html>' | gsutil cp - gs://my-bucket/foo

我认为,--stdin标志会更明确和更可取。

© www.soinside.com 2019 - 2024. All rights reserved.