Skip to content

Instantly share code, notes, and snippets.

@Groxx
Created May 22, 2015 01:10
Show Gist options
  • Save Groxx/5e89c56f664210ef6246 to your computer and use it in GitHub Desktop.
Save Groxx/5e89c56f664210ef6246 to your computer and use it in GitHub Desktop.
#!/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