Seeking help with how to escape "&" in ADB command line -- any guidance would be much appreciated!
I am attempting to extract .epub book files from an Android tablet running B&N Nook app. The NOOK app stores ebook files in "/data/data/bn.ereader/files/B&N Downloads/Books" The "B&N Downloads" string is causing problems in ADB shell commands. I have tried escaping the "&" and "space" in the following ways ...
$ ./adb shell cd ./data/data/bn.ereader/files/B&N Downloads/Books (original command)
$ ./adb shell cd ./data/data/bn.ereader/files/B\&N\ Downloads/Books
$ ./adb shell cd ./data/data/bn.ereader/files/'B&N Downloads'/Books
$ ./adb shell cd './data/data/bn.ereader/files/B&N Downloads/Books'
$ ./adb shell cd ./data/data/bn.ereader/files/"B&N Downloads"/Books
$ ./adb shell cd ./data/data/bn.ereader/files/B^&N^ Downloads/Books
(that last from suggestion in another answer: Trying to give "&" as part of adb shell input text)
always resulting in the same error ...
/system/bin/sh: N: not found
/system/bin/sh: cd: /data/data/bn.ereader/files/B: No such file or directory
MacBookPro 9,2 (mid-2012)
System Version: macOS 10.14.6 (18G9323) "Mojave"
Kernel Version: Darwin 18.7.0.
Target Android device:
B&N Nook HD+ (running CyanogenMod)
Android version: 7.1.1
Kernel version: 3.0.101 (dmaces@gc-xenial #1)
Build Number: cm_ovation-userdebug 7.1.1 NMF26Q 161222 test keys
Also tried this on a Lenovo Tab M10 Plus 3rd Gen with the same results:
Android version: 12
Kernel version: 4.14.186-ga2e751134649
Build Number: TB125FU_S000118_220927_ROW
[NOTE: I have completed my original task by simply executing a "pull" of the whole darn directory tree above the problem "B&N Downloads" folder, but the issue of how to escape "&" remains]