你怎么管s3cmd得到一个变种的结果呢? [英] How do you pipe the result of s3cmd get to a var?
本文介绍了你怎么管s3cmd得到一个变种的结果呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将图像从S3,处理它的EC2,并保存到S3不同的文件夹。我想在此过程中没有将文件保存到EC2。
I need to get an image from S3, process it on an ec2, and save it to a different folder on S3. I would like to not save the file to ec2 during the process.
是否可以管的结果s3cmd获得S3://桶/图像为VAR?它似乎并没有打印到标准输出?
Is it possible to pipe the result of "s3cmd get s3://bucket/image" to a var? It does not seem to print to standard output?
推荐答案
这将是更好,如果你能在你的情况显示其输出的农产品 s3cmd
。但是,如果你真的想在命令的输出保存到一个变量,你做这种方式:
It would be better if you could show which output produce s3cmd
in your case. But if you really want to save the output of the command to a variable you do it this way:
$ a=$(s3cmd get s3://bucket/image)
当您想要保存标准错误
也,你做:
When you want to save stderr
also, you make:
$ a=$(s3cmd get s3://bucket/image 2>&1)
只有当标准错误
:
$ a=$(s3cmd get s3://bucket/image 2>&1 > /dev/null)
这篇关于你怎么管s3cmd得到一个变种的结果呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文