Skip to content

Instantly share code, notes, and snippets.

Created April 30, 2020 08:34
What would you like to do? script from Chiu-ki Chan's video on terminal tricks
#! /bin/bash
today=$(date +%Y%m%d)
for path in $(adb shell ls /sdcard/Pictures/Screenshots/*"${today}"*); do
name=$(basename "$path")
if [ ! -f "$name" ]; then
adb pull "$path"
Copy link

mikepenz commented May 6, 2020

Not sure if it's due to zsh but I had to add ' around the shell statement. E.g.

adb shell 'ls /sdcard/Pictures/Screenshots/*'"${today}"'*'

Thanks a ton for creating this gist :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment