Accessing my Droid Maxx from a shell script
clanlaw at gmail.com
Tue Dec 29 09:04:29 UTC 2015
On 29 December 2015 at 08:23, MR ZenWiz <mrzenwiz at gmail.com> wrote:
> indir=$DevicePath/'Internal\\ storage' ### This never works
> ls $indir
> The line where it has the comment "This never works" - I have tried
> single and double quotes, single and double escape (backslash) in
> every combination that will allow the DevicePath variable to be read,
> and the result is always the same:
To get that showing what you expect use
until it shows what you expect, don't worry about escaping spaces at
this point, just get the string to be
to do the ls, or anything else you want to do with the name.
> mar at marbase:~ $ xtlist
> XT1080 path is '/run/user/500/gvfs/mtp:host=%5Busb%3A003%2C086%5D'
> ls: cannot access
> /run/user/500/gvfs/mtp:host=%5Busb%3A003%2C086%5D/Internal\\: No such
> file or directory
You have not shown us the actual command you entered so can't comment
on why this doesn't work.
> ls: cannot access storage: No such file or directory
> mar at marbase:~ $ ls /run/user/500/gvfs/mtp:host=%5Busb%3A003%2C086%5D
> Internal storage/
That is not surprising.
> mar at marbase:~ $ ls
> /run/user/500/gvfs/mtp:host=%5Busb%3A003%2C086%5D/Internal\ storage
That is one of the right ways to do it. You could also just put
quotes round the full name and don't escape the space.
> Alarms/ com.vcast.mediamanager/ kindle/ Pictures/ Vault/
> amazonmp3/ DCIM/ Movies/ Podcasts/
> Android/ Download/ Music/ Ringtones/
> Audible/ Highlight Reels/ Notifications/ SmartVoiceRecorder/
> I've tried having the script cd into the directory and it still won't
> list down past the top level "Internal storage."
See my initial comment.
More information about the ubuntu-users