[nSLUG] Different behaviour between typed and script in bash

Joel Maxuel j.maxuel at gmail.com
Fri Aug 15 00:48:02 ADT 2014

Hey all,

I am looking to connect my LG Android phone to my Debian box, and have come
into a little bit of trouble.  Am using jmtpfs.  After a (
http://roger.steneteg.org/299/mount-mtp-device-on-debian-7-wheezy/) little
coaxing, I was able to issue a set of commands to do what I want:

To connect and open in a file manager:
jmtpfs /media/android
thunar /media/android/[/CODE]

To disconnect:
fusermount -u /media/android[/CODE]

I have tried this in bash scripts to make things easier, (with the
#!/bin/bash header) but I get this on the connect script (whereas it works
fine typed into console):

[CODE]joel at cybaryme:~$ mtp-connect
libmtp version: 1.1.6

Device 0 (VID=1004 and PID=61f9) is a LG Electronics Inc. V909 G-Slate.
PTP_ERROR_IO: failed to open session, trying again after resetting USB
LIBMTP libusb: Attempt to reset device
Android device detected, assigning default bug flags
Usage: connect
Commands: --delete [filename]
          --sendfile [source] [destination]
          --sendtrack [source] [destination]
          --getfile [source] [destination]
          --newfolder [foldername]

Does not mount, and interestingly enough, Thunar does not load either.  As
a note, the device always has to reset in older for it to work, so the
behaviour is different from "Usage" onward (besides the first line, which
does not show in the original, typed version).

Any suggestions, like quotations?  Unfortunately jmptfs didn't come with a
man page.

Joel Maxuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/pipermail/nslug/attachments/20140815/7f06f8ab/attachment.html>

More information about the nSLUG mailing list