LoginSignup
5
1

More than 3 years have passed since last update.

AWS CLIで出力される文字列のダブルクォートを外す方法

Posted at

--output text をつければ外れます。

つけない場合.sh
$ aws lambda get-function \
  --function-name $NAME \
  --query "Configuration.FunctionArn"
> "arn:aws:lambda:ap-northeast-1:1234567890:hoge"
つけた場合.sh
$ aws lambda get-function \
  --function-name $NAME \
  --query "Configuration.FunctionArn" \
  --output text
> arn:aws:lambda:ap-northeast-1:1234567890:hoge

参照: Convert to plain text

デフォルトのJSON形式は常にダブルクォートに囲まれているため、前のコマンドで出力された値を次のコマンドにパイプするには不都合です。
--output text をつけることで出力内容がJSONからテキストに変更され、ダブルクォートが外れます。

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1