I'm trying to write a simple bash script to access my Android device when I connect it via USB, but I'm kinda new to this, so I'm having a hard time with a simple command.
What I wrote:
#!/bin/bash
MOBILE="/run/user/${UID}/gvfs/mtp*/Internal shared storage"
cd ${MOBILE}/
What I'm getting:
./mobile.sh: line 5: cd: /run/user/1000/gvfs/mtp*/Internal: No such file or directory
How can I make it understands the spaces in the path?
EDIT: I tried this way:
#!/bin/bash
MOBILE="/run/user/${UID}/gvfs/mtp*/Internal\ shared\ storage/"
CONTAINER="/media/ecrypted/"
cd "$MOBILE"
And I got:
./mobile.sh: line 6: cd: /run/user/1000/gvfs/mtp*/Internal\ shared\ storage/: No such file or directory
But if I manually run on terminal cd /run/user/1000/gvfs/mtp*/Internal\ shared\ storage/
, it works.