Making my script

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

Making my script

Postby keenan on Tue Oct 30, 2007 3:42 pm

ok, i'm totaly new to linux and scripting so i need some help....
i was using kubuntu for few weeks and i really liked the 'Right Click -> Actions -> Send using bluetooth' so i want to make a script that would send the file i right clicked with the mouse to my cellphone.... this is what i came up with....

#!/bin/bash
# W610

sudo gnome-obex-send -d 00:1B:59:61:02:8A $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS

exit 0


now, this works as long as the directory where the file is (or the file) has no spaces.... if i try to send some pic from '/home/darko/My Pictures' gnome-obex-send says something like 'can't find file /home/darko/My'

so, my question is how to make it work with the spaces
i know where to put script and how to make it executable, i just need the help with code....

thx,
darko.
keenan
Level 1
Level 1
 
Posts: 2
Joined: Tue Oct 30, 2007 3:31 pm

Linux Mint is funded by ads and donations.
 

Postby clem on Tue Oct 30, 2007 4:22 pm

try with quotes around the variable.
Image
User avatar
clem
Level 15
Level 15
 
Posts: 5548
Joined: Wed Nov 15, 2006 8:34 am

Postby gandhi on Tue Oct 30, 2007 6:56 pm

Yeah, I'd try with quoted variables too.

Clem, you and I - we're very much alike, don't you think?

Do you do it gay-wise?
gandhi
Level 1
Level 1
 
Posts: 1
Joined: Tue Oct 30, 2007 6:54 pm

Postby keenan on Wed Oct 31, 2007 6:53 am

i tried with the quotes before this post, but it didn't work either.... even if this post says it should.. maybe i've done smth wrong....
but then i found this page where it's done using nautilus actions, so if anybody else needs this...it works... :P
keenan
Level 1
Level 1
 
Posts: 2
Joined: Tue Oct 30, 2007 3:31 pm

Postby clem on Wed Oct 31, 2007 9:04 am

gandhi: Not sure what you mean. Sorry.

Clem
Image
User avatar
clem
Level 15
Level 15
 
Posts: 5548
Joined: Wed Nov 15, 2006 8:34 am


Return to Newbie Questions

Who is online

Users browsing this forum: Bing [Bot], Distro-Don and 27 guests