-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adb-sync seems to close standard input? #38
Comments
Interesting issue. This is probably because adb-sync calls "adb shell", which in turn connects stdin to the phone. I think I can fix this by making adb-sync not connect stdin to its subprocesses anymore. |
I face a similar problem : the directories I want to sync are listed in a CSV file 'file.csv' (2 fields on each line : SOURCE,DEST). When I run the bash script only the first line of file.csv is read and consequently, only the first directory is synced. I've found a workaround. Instead of a 'while... do... done' loop, I use a 'for... do... done' loop. #!/bin/bash It works fine, but I couldn't explain why ! |
Pretty sure it is not adb-sync but adb that eats standard input, so I
suggest filing a bug against adb. We could work around it in adb-sync but
it would probably be preferred to fix adb.
Having said that, as a workaround you can also use
adb-sync ... </dev/null
in your scripts.
…On Sun, Jul 18, 2021, 05:23 Jarival ***@***.***> wrote:
I face a similar problem : the directories I want to sync are listed in a
CSV file 'file.csv' (2 fields on each line : SOURCE,DEST).
When I run the bash script
#!/bin/bash
while read line; do
./adb-sync $SOURCE $DEST
done < file.csv
only the first line of file.csv is read and consequently, only the first
directory is synced.
I've found a workaround. Instead of a 'while... do... done' loop, I use a
'for... do... done' loop.
#!/bin/bash
for line in $(cat file.csv); do
./adb-sync $SOURCE $DEST
done
It works fine, but I couldn't explain why !
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB5NMF6XBEROXSTYTCPEZ3TYKMRLANCNFSM4G44LTUA>
.
|
foo
(containing file1.txt
) andbar
(containing file2.txt
) are two directories under/sdcard
on my phone.When I run the following script
test.sh
on my computer:The result is that only the first directory
foo
is synced:The problem is
read -r dir
fails in the second iteration, perhaps implying stdin in closed.The text was updated successfully, but these errors were encountered: