IzzySoft / Adebar

Android DEvice Backup And Report, using Bash and ADB. Moved to https://codeberg.org/izzy/Adebar -- this is only a mirror now.
GNU General Public License v2.0
246 stars 41 forks source link

Compatibility with MobaXterm/Windows #24

Closed JimboJoe closed 7 years ago

JimboJoe commented 7 years ago

PR corresponding to issue #23

JimboJoe commented 7 years ago

You're damn right, I broke the logic on the spacing part... weird it was working! I put back the ".:" part, I took it out while debugging and forgot to put it back. I've found an elegant proposition that should cover the space and tab spacing between the device name and the "device" part. I'm still puzzled by the "$" that prevents from matching... That should have something to do with EOL differences... I attached my adb devices output if you want to have a look : adb_devices.txt

IzzySoft commented 7 years ago

Thanks Jim. I've checked my regex against your adb devices output, and it works fine as expected.

Thanks for the update, too. As it still lacks the $ the issue I described would remain (and I wonder why you should have issues in that place, while not in the other at line 104). You could try adding it back as \s*$ though to see if that makes a difference. Note: If you just try that grep in the command line (with the \s*$) it will look like it matched an empty line – as the ^M (CR) blanks out the result. Redirecting it to a file however shows the full line. I've just tested the full condition here, it seems to work. If \s doesn't work, there's also [[:space:]].

And while [[:blank:]] should almost be the same as \s, I'm not 100% sure about that. But I don't see any issue with that in this place either, as I expect nothing but tab or spaces there.

TL;DR: Could you please check if the $ can be placed back – if necessary, with a leading \s* or [[:space:]]*?

JimboJoe commented 7 years ago

You got it right! It wouldn't do with "\s", but worked with "[[:space:]]" before the $.

IzzySoft commented 7 years ago

Thanks a lot! Looks very good now, so I'm merging this. May I ask you to add your configuration to #7 then?

JimboJoe commented 7 years ago

Done, thanks again!