Created
September 30, 2016 12:35
-
-
Save AndroPlus-org/914e6aac89da9a6a6f8ee9e22c099867 to your computer and use it in GitHub Desktop.
gdrive (https://github.com/prasmussen/gdrive) で、Google ドライブのルートディレクトリにある特定のディレクトリのIDを取得する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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