LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-08-2004, 05:39 PM   #1
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Rep: Reputation: 47
how to create link to an executable?


situation:

got an app in: /usr/local/cheese
it is called: cheese

when i ssh in i want to be able to just type: cheese

and then get my cheese.

Do i need to make a link? (if so how)
Do i need to add cheese to my path? (if so how)

Thanks
 
Old 10-08-2004, 05:46 PM   #2
ranger_nemo
Senior Member
 
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
You can add a link to your ~/bin/ ... "ln -s /usr/local/cheese/cheese ~/bin/cheese". ~/bin is pretty much standard in path for all the distros I've seen.

Or, you can add /usr/local/cheese/ to your path ... Edit ~/.bash_profile . There will be a line that says something like "PATH=$PATH:$HOME/bin". Add ":/usr/local/cheese" to the end. Be sure you have the colon, that's how it differentiates.

Or, you can add an alias to the ~/.bash_profile ... Down near the bottom of the file, add a line "alias cheese=/usr/local/cheese/cheese".
 
Old 10-08-2004, 06:10 PM   #3
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Original Poster
Rep: Reputation: 47
slackware doesn't have .bash_profile

i tried the link thing and i get:
command not found
if i do ./cheese on the link i get
Too many levels of symbolic links
 
Old 10-08-2004, 06:29 PM   #4
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
The app is located at /usr/local/cheese/cheese or /usr/local/cheese/bin/cheese? Anyway, find exactly where the executable binary is and do:

ln -s /path/to/binary /usr/local/bin/cheese

as root. Then just type cheese on the command line without the "./".
 
Old 10-08-2004, 06:32 PM   #5
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Original Poster
Rep: Reputation: 47
did that:
root@Olympus:~# ln -s /usr/local/tapeware/twadmin /usr/local/bin/twadmin
root@Olympus:~# ls
Desktop/ dead.letter installs/ loadlin16c.zip server\ build.txt
News/ hupgpm* loadlin16c.txt server\ build.doc
root@Olympus:~# twadmin
Exec: Unable to find admin.bin
root@Olympus:~#
 
Old 10-08-2004, 06:48 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by Finlay
slackware doesn't have .bash_profile
Not unless you edit and save it ...


Cheers,
Tink
 
Old 10-08-2004, 06:51 PM   #7
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Original Poster
Rep: Reputation: 47
Tink gets a negative affero for that
 
Old 10-08-2004, 07:17 PM   #8
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
with Slackware, you make your own ~/.bashrc and/or ~/.bash_profile.....
 
Old 10-08-2004, 09:22 PM   #9
datadriven
Member
 
Registered: Jun 2003
Location: Holly Hill, Florida
Distribution: Slackware 10.1
Posts: 317

Rep: Reputation: 30
I'm kind of curious about what that "cheese" program does. ;-)
 
Old 10-08-2004, 11:03 PM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Quote:
Originally posted by Finlay
did that:
root@Olympus:~# ln -s /usr/local/tapeware/twadmin /usr/local/bin/twadmin
root@Olympus:~# ls
Desktop/ dead.letter installs/ loadlin16c.zip server\ build.txt
News/ hupgpm* loadlin16c.txt server\ build.doc
root@Olympus:~# twadmin
Exec: Unable to find admin.bin
root@Olympus:~#
See if twadmin isn't actually a script, if it's try adding cd /usr/local/tapeware/ on it (before it tries to find admin.bin). If not, make a script in /usr/local/bin/ with a code like this inside:
Code:
#!/bin/sh
cd /usr/local/tapeware/
./twadmin
 
Old 10-09-2004, 02:50 AM   #11
Finlay
Senior Member
 
Registered: Mar 2003
Location: Seattle
Distribution: Slackware ?-14.1
Posts: 1,029

Original Poster
Rep: Reputation: 47
twadmin is binary
-rwx------ 1 root root 5276 2004-10-03 03:05 twadmin
that script works, so i will use that.

no cheese program, just trying to simplify, sometimes when you mention a real app you start a flamewar on how good the app is
 
Old 10-09-2004, 08:16 AM   #12
andrade
Member
 
Registered: Oct 2004
Location: Portugal
Distribution: Ubuntu
Posts: 41

Rep: Reputation: 15
I've done a little package with a nice .bashrc and bash_profile
I'm not at home so i make it in Windows so i can't put it .tgz
the site is that http://members.lycos.co.uk/jackberse...e_fix_i486.zip
download it
extract it
go to the root folder of the extracted archive
built a .tgz with the file/folders... i think when you're there you can do that it with tgz command
make installpkg ....tgz
login as root
cd /root
cp .bashrc /home/user (user name)
cp .bash_profile /home/user
cd /home/user
chown user .bash*

now you must logout and login
With this script you also stay with a nice login name, and also you can open X applications and kde applications even if you change user

like that:
BEFORE YOU INSTALL THE PACKAGE
login in a console as some user non-root
su
put the pass of root user
now try to open any X application... you won't get it work
do su username
and try to open a kde application... like kwrite... you can cause it loose the bin path /opt/kde/bin
With my little fix Slackware 10 will be much better

Last edited by andrade; 10-09-2004 at 08:17 AM.
 
Old 10-09-2004, 08:19 AM   #13
andrade
Member
 
Registered: Oct 2004
Location: Portugal
Distribution: Ubuntu
Posts: 41

Rep: Reputation: 15
Other thing:

To link anything better make it with ln -sf
Anyway don't install packages in /usr/local unless you know what you're doying
When you install a src package configure it with
./configure --prefix=/usr
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Create an executable file in linux which opens by double-clicking it shivanand Linux - General 5 08-30-2005 12:10 AM
Problem with gcc: configure: error: C compiler cannot create executable abefroman SUSE / openSUSE 4 05-11-2005 06:12 PM
Create .rpm for executable file from Kylix 3 swg079 Linux - Newbie 4 10-16-2004 07:00 AM
Evolution Executable Link Saxywolf Linux - Newbie 2 08-28-2004 04:38 PM
gcc can't create executable Aeion Linux - Newbie 1 04-06-2004 12:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration