Skip to content

Instantly share code, notes, and snippets.

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"

This comment has been minimized.

Copy link

@mikepenz 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