2

This construction failing

adb shell "for i in `seq 10`; do command; done"

But if run it separately it just fine

adb shell
root@vbox86p:/ # for i in `seq 10`; do command; done

Am I missing something?

Update:

Max OSX with zsh

ar-g
  • 3,417
  • 2
  • 28
  • 39

1 Answers1

2

I tried this command and it worked for me:

adb shell "for i in 'seq 10'; do echo "1"; done"

Try to change the quotation symbols in the loop.

Edit:

Try this instead:

adb shell "for i in 1 2 3 4; do echo "1"; done"
Empario
  • 402
  • 6
  • 19
  • interesting, but it will work out only once inside and outside the adb shell, when should repeat 10 times. The old quotation do work properly but only inside of adb shell – ar-g Jan 05 '16 at 09:55
  • 1
    Try this: adb shell "for i in 1 2 3 4; do echo "1"; done" – Empario Jan 05 '16 at 18:26
  • 1
    cool, thanks it's totally working, seems the problem was with passing quotations, plz edit your answer – ar-g Jan 06 '16 at 10:37
  • No problem, I am happy to help out. For some reason you can not push "seq 10" to adb shell and have to use 1 2 3 4 instead. – Empario Jan 06 '16 at 17:57