linux 在尝试运行eval命令时出现“zsh:file name too long:”

wi3ka0sx  于 2023-05-16  发布在  Linux
关注(0)|答案(1)|浏览(339)

我正在我的linux上运行一些集成测试。作为设置的一部分,我们在本地服务器上生成服务,并对它运行集成测试。在运行集成测试之前,我们执行以下命令:
eval $(aws ecr get-login-password --region us-west-2)
当我执行上面的命令时,我得到下面的错误:

zsh: file name too long: eyJwYXlsb2FkIjoiK3lEdnRqT1BESzdXa0xZcVhHZ05DSUR6Mm5tN0xRREk5MG0rcStvODgvZUN5V2VRVXpmdnpVam02bjM5SXUveG5icDZvdTZ1M0UxS2J6MDdTTFhoTktDM05DTWVyelZoeEwxeDVOZ2JxM3RyUzVtSy9WeE5nNXlLWFVOSldFdmtma3BHQUhMc1Fxa0tiYXNPcEp2cWNDUy9VV0dOblc3WXA1ZjRmK0MzVnh2THdZWHcwenNLc1FNOTZxT2Q5Y2pTN1JlQ3RDSHpwb0RpOWRVZWxTSE9ocVRlVmsvUVY2SnJyczBzR3lDcGJpdm9sdVZvVzBBdDJkZzVkVXBrbG5laHIwd2pNZEF3Y3pCT0ZjTzllamJNMlNMR2tOemRkdnJ5ZERKaVltQnZVODVxMW1TUXdPSGFDOWt1MERDWUJDYkNPeUVTMkV2dFVWZHlxSGhBZjdoSUlnZi9IRytldmdUSVF6OGZHS3p6RXFNdENvNEZMd1lzVDY3TjJPdk9nWHh3amtkY01HaEw2cjM3cDFOOSs3Wi9oQnFNbjlnRzUyRWx6V3VSclVSYXBDalJpeVhuWjA2bGUzRmFxRHNrZk1kV3h2V1pObEZTb0dldFcreUY2TlpUbW81WCtIREpZdUNWbjNvUjNHbFZjbitUemNrbmZ6Zi8zSmVJeXdhOE4rdFVndFpkY2txTGt5WXZEU21CV1NxOXpiL0dXbkZQdEdWbkRVQzlPNndjZVF1MXRlU2ZyVW56V1FVQy9UUzJzZFRYbSt0YVQ3SVJ1MC9QYTB2cG5QZmVHZ1NSQVh0dzdBOWg3cDZVQXIzaTZzTjY3QXdWeXFscT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WZzhtcHZnZStBbGNyMVJFeGhLKzlGSWJYWXhVUlRlS1pwSDhOcmJtVGNtYm5QbnRuNnpIUWJMT1FyelFZVnl6YzlTbHlFSWE1bHlxTmZuQzExK0oyV0tINXdJYWo4d1A5di80a0J3VC8xYklXdzRFRTJkR2lGcVdtZ0ZVNFpjWHF1L09HRWJvaW5HZ0tGRHFTd21pSTAycHVvbUFYV1FsQ0VFNGd5TEd0Ynp1bGRnMk14bHFaSU5BSWZFdWYrdTlSQUJ5MmluWGRsNFUzNWYvbytQWmhlaTBkbmcvN2xLTlBqN2xWT0NpeVF3SzlDWkk1RzcvaExjL1VVY1JLZ0hVOWF2RVE5TEhoUVpERTZaQTFSbi82a1RUVFNUelNhUHZBZ0RXRk5UTFNuVkNOMWw1VnkiLCJkYXRha2V5IjoiQVFFQkFIajZsYzRYSUp3LzdsbjBIYzAwRE1lazZHRXhIQ2JZNFJJcFRNQ0k1OEluVXdBQUFINHdmQVlKS29aSWh2Y05BUWNHb0c4d2JRSUJBREJvQmdrcWhraUc5dzBCQndFd0hnWUpZSVpJQVdVREJBRXVNQkVFREt4Szd5OGRsWmZsNFFnRUtRSUJFSUE3c2RBZHVXUys1UEFjNExYa08zalhncWpWVkVYS0Z2a2lhZ0tjQm9hc3h2eHA0S0pESy9abDJKSmszQlFpRkJGYUtaRUdZeGFEYWJIN1hwMD0iLCJ2ZXJzaW9uIjoiMiIsInR5cGUiOiJEQVRBX0tFWSIsImV4cGlyYXRpb24iOjE2ODM4Njg3OTR9

我不知道如何解决这个问题,因为eval命令并没有真正尝试创建一个文件,不知道这里发生了什么。我能够正确执行上述命令,但突然开始得到上述错误。

bhmjp9jg

bhmjp9jg1#

尝试
ecr_login=$(aws ecr get-login-password --region us-west-2) && eval "$ecr_login"
这样做意味着将输出赋值给变量ecr_login,将内容存储到变量中,而不是直接执行输出。它应该避免“文件名太长”错误。

相关问题