Page 1 of 2

Some one use Linux?

Posted: Mon Jun 05, 2006 11:08 am
by shellvpower
I have two PC, one with windows and the other with linux....
I'm not a linux expert but I can use it a bit...

But...

I'd like to create shortcut to desktop for a file that I have to executo through the command line...
Example:
CODE

cd /home/user/folder       *I press Enter key*

./program.sh                   *Press enter key and the program starts*

I'd like that I can go in the terminal and write only the word "program" and than the program starts....like I do for mozilla for example...

Thanks in advance

Posted: Mon Jun 05, 2006 1:41 pm
by emanon
who.am.i is the inhouse linux d00d

I have a second pc that has linux on it that I tinker with...so I know a little.

can you right click on the desktop and choose New-> shortcut to application, then enter the path to your shell script. for the properties of the shortcut there should be an option for "run in terminal"

at least there is in the distro I am using (Vector Linux SOHO 5.1) with KDE environment

Posted: Tue Jun 06, 2006 8:43 am
by WAY
Wait, so do you want a shortcut on

a) your desktop like you have for Home, CD Drive
/cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> your panel bar where you have your web browser, email app, and 'start' menu

or

c) a 'shortcut' in a terminal so that when you type the command, it will launch the program..?

a) and /cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> can be accomplished by right-clicking and selecting create new -> shortcut
c) can be accomplished by opening Terminal and typing:
(replace <shortcutname> with the command you wish to type to execute the commands)

CODEcd /usr/bin

gedit <shortcutname>

Now type in the window that appears:
CODE#!/bin/bash



# Here are the commands I wish to run (replace with your own):

cp /home/whoami /usr/backups -R

Save and close.
You should now be able to type <shortcut name> at any time in a Terminal session.
You can add a custom path to your system PATH variable instead, and place the bash script there.

-tech,
who.am.i

Posted: Tue Jun 06, 2006 12:04 pm
by shellvpower
THANKSSSSSSSSS

GRAZIE


Finally someone that tell me exactly how do that.....I was interest in in c) option...

Posted: Wed Jun 07, 2006 7:40 am
by shellvpower
emh....little problem....

here's whai I did:

cd /usr/bin/
sudo gedit edonkey


then in gedit I've done this:

#!/bin/bash

/home/<user>/eDonkey2000/
./rundonkey.sh

when I try to execute

edonkey in the terminal or I have a message that I don't have the right permission...if I try sudo edonkey say another error that I don't remember now....

PS
I use ubuntu

Posted: Wed Jun 07, 2006 7:51 am
by WAY
You'll need to set the permissions on rundonkey.sh

Use the following commands (as su or by using sudo) - replace <username> with your current username:
CODEcd /usr/bin

sudo chown <username> edonkey

and, to fix something I forgot to include in my original post, type (you shouldn't need su/sudo anymore) in the same window:
CODEchmod +x edonkey
which makes the script executable!

Have fun!

-tech,
who.am.i

(oh, and I use Ubuntu when I can too, lol /:D" style="vertical-align:middle" emoid=":D" border="0" alt=":D" />)

Posted: Thu Jun 08, 2006 6:52 pm
by shellvpower
Nothing to do...I've done exactly what you've write...but I have this error:
CODE

/usr/bin/edonkey: line 3: /home/user/eDonkey2000/: is a directory

/usr/bin/edonkey: line 4: ./runDonkey.sh: No such file or directory

I don't understand....all the path are right! mmm

the scrip I've crated is:
CODE

#!/bin/bash



/home/user/eDonkey2000/

./runDonkey.sh

Posted: Thu Jun 08, 2006 11:55 pm
by WAY
change your script to

CODE#!/bin/bash



# Starts eDonkey2000 via runDonkey.sh script

./home/user/eDonkey2000/runDonkey.sh

That should run correctly.
If you need to open the file to edit, type

CODEsudo gedit /usr/bin/edonkey

in a console terminal.

Posted: Sun Jun 11, 2006 4:47 pm
by shellvpower
I've done what you write....
but I have the same error....

./home/user/eDonkey2000/runDonkey.sh no such file or directory...

and the path is right.....

thanks anyway

Posted: Sun Jun 11, 2006 11:58 pm
by WAY
Hmmm..

So, you've extracted the eDonkey Linux download into your home diretory, and your username is 'user'..?