1

I am trying to pass the files from find command to adb push like this:

find . -name "test0[4-8]*.py" -exec adb push {} \; /storage/emulated/0/ 

I get an error find: paths must precede expression: /storage/emulated/0/

How can I specify that /storage/emulated/0/ is not a path.

2 Answers 2

2

The semicolon indicating the end of the exec command should be at the end of the exec predicate:

find . -name "test0[4-8]*.py" -exec adb push {} /storage/emulated/0/ \; 
1

I'm assuming /storage/emulated/0/ is the path on the remote device? So it should form part of the command, your \; comes before it.

find . -name "test0[4-8]*.py" -exec adb push {} /storage/emulated/0/ \;

if that still gives you issues put "/" for each "/" to escape them. Effectively everything from -exec to \; is sent into a sub shell with {} replaced with the path to each file found.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.