当我执行命令时:
for el in $(adb shell ls /mnt/sdcard/ | grep mem_); do adb pull /mnt/sdcard/${el} android_mem; done
我明白了:
' does not existmnt/sdcard/mem_AI
' does not existmnt/sdcard/mem_Alarms
' does not existmnt/sdcard/mem_Android
' does not existmnt/sdcard/mem_Autodesk
' does not existmnt/sdcard/mem_Cardboard
' does not existmnt/sdcard/mem_DCIM
...
但是,如果我执行此操作,例如,adb pull /mnt/sdcard/mem_DCIM android_mem
我得到0 KB/s (20 bytes in 0.080s)
,即确定。为什么会这样?
答案 0 :(得分:3)
问题是 $(document).on("click", ".glyphicon-trash", function (){
$(this).parent().parent().remove(); // remove row
最后会返回adb shell ls /mnt/sdcard/ | grep mem_
,因此无法正确提取文件。
因此您需要使用\r
将其删除,例如:
sed -r 's/[\r]+//g'