Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
gdrive (https://github.com/prasmussen/gdrive) で、Google ドライブのルートディレクトリにある特定のディレクトリのIDを取得する
#!/bin/sh
# 例ではディレクトリ名に「dora」を含むものだけを表示している
# 複数一致しても最初のディレクトリのIDしか返せないゴミスクリプト
gfolderlist=`gdrive list --max 1 --name-width 0 --query "trashed = false and 'me' in owners and 'root' in parents and mimeType = 'application/vnd.google-apps.folder' and name contains 'dora'"`
gfoldernames=`echo ${gfolderlist} | sed "s@Id Name Type Size Created \([a-zA-Z0-9]*\).*@\1@"`
echo ${gfoldernames}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.