[nSLUG] Different behaviour between typed and script in bash

Stephen Gregory nslug at kernelpanic.ca
Fri Aug 15 02:10:53 ADT 2014

Did you name your script mtp-connect? My guess is that you are running
/usr/bin/mtp-connect not the script you wrote. Check the output of the

$ which mtp-connect


On Thu, Aug 14, 2014 at 11:48 PM, Joel Maxuel <j.maxuel at gmail.com> wrote:
> 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:
> [CODE]
> jmtpfs /media/android
> thunar /media/android/[/CODE]
> To disconnect:
> [CODE]
> 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
> interface
> 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]
> [/CODE]
> 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.
> --
> Cheers,
> Joel Maxuel
> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.ca
> http://nslug.ns.ca/mailman/listinfo/nslug

More information about the nSLUG mailing list