Created
July 6, 2013 14:39
-
-
Save seamountain/5940102 to your computer and use it in GitHub Desktop.
Shell Script for Android
- Check existence of the file
This file contains hidden or 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
# Check directory existance one liner | |
adb shell '[ -e /sdard ]; echo $?' | |
# Use with a if | |
DIR=/sdcard1 | |
COMMAND='[ -e '"$DIR"' ] && echo $?' | |
IS_EXIST=`adb shell $COMMAND` | |
if [ -n "$IS_EXIST" ]; then | |
echo "$DIR is exist." | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment