Created
May 22, 2015 01:10
-
-
Save Groxx/5e89c56f664210ef6246 to your computer and use it in GitHub Desktop.
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/bash | |
# Copies anything sent over stdout. | |
# e.g. `screencap -p` or `run-as com.whatever cat databases/file.db` | |
if [ $# -ne 2 ]; then | |
echo "Needs two arguments." | |
echo "Example usage: " | |
echo " acp 'run-as com.whatever cat databases/file.db' file.db" | |
echo " acp 'screencap -p' screen.png" | |
echo "Works by translating anything sent over stdout into something that can be saved to a file" | |
exit 1 | |
fi | |
adb shell "$1" | perl -pe 's/\x0D\x0A/\x0A/g' > "$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment