我正在运行一个普通的shell脚本,在这里我想在运行aws
命令之前设置代理:
export http_proxy=http://proxy.url.com:8099
aws s3 ls
但是我遇到了这个错误:
Caught: java.io.IOException: Cannot run program "export": error=2, No such file or directory
java.io.IOException: Cannot run program "export": error=2, No such file or directory
at com.capitalone.cep.lensOps.run(lensOps.groovy:13)
当我在bash中运行export
命令时,该命令可以正常工作,那么该如何使其正常工作呢?
答案 0 :(得分:1)
export
是一个shell功能,而不是一个外部程序。要在其环境中运行具有特定值的程序,可以改用env
。
env http_proxy=http://proxy.url.com:8099 aws s3 ls