Skip to content

Instantly share code, notes, and snippets.

@stknohg
Created March 7, 2019 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stknohg/20d808ed2a85ef84a60c5c22455279b3 to your computer and use it in GitHub Desktop.
Save stknohg/20d808ed2a85ef84a60c5c22455279b3 to your computer and use it in GitHub Desktop.
AWS CLIすべてのサブコマンドを列挙するスクリプト
#!/bin/bash
for c in $(aws list-commands 2>&1 | tail -n +9 | awk -F'|' '{printf "%s\n%s\n",$1,$2}' | tr -d ' ')
do
# wait, help,空白 は除外
eval "aws $c list-commands" 2>&1 | tail -n +9 | awk -F'|' '{printf "%s\n%s\n",$1,$2}' | tr -d ' ' | sed -e /wait/d -e /help/d -e /^$/d | awk -v "v1=$c" '{printf "aws %s %s\n",v1,$0}'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment