 |
Linux Format forums Help, discussion, magazine feedback and more
|
| View previous topic :: View next topic |
| Author |
Message |
SiriusHardware
Joined: Tue Sep 25, 2012 7:41 pm Posts: 51
|
Posted: Tue Oct 30, 2012 10:45 pm Post subject: Add to Debian search path for programmes? |
|
|
I'm trying to install, run and use a cross-assembler. Debian Squeeze.
This program is written in Python (V2) and is apparently configured as a Python 'Package', with a small launcher outside of a main package directory containing all the Python modules which make up the program.
This linux PC has Python V2.6 installed, as it came on the distro.
The installation instructions for Linux say to create home/you/bin (where 'you' is my username, presumably) - it did not already exist, so I've done that and now have that directory structure in place.
Next step is to copy the launcher file XASM to home/you/bin, along with the directory containing all the support files for XASM
The notes on programme installation say that on some distros such as Ubuntu the mere act of creating home/you/bin will cause an appropriate section to be added to the 'PATH' automatically, but otherwise to do it manually.
I've tried my best to understand how to do this, but at the moment the only way I can run the programme is to go to home/you/bin where I can actually see the XASM file and type (for example)
| Code: |
python XASM 6502.asm
|
That works.
As far as I can see, the 'profile' file in /etc profile does have a bit pointing to my usr/bin directory and should be looking there, but when I type
| Code: |
python XASM <enter>
|
...from any other place in the directory tree, BASH can not find XASM. If it did find it, I would expect to be asked for the .asm file name. Instead, it BASH just complains that it can not find XASM at all.
.
Here's what I hope is the relevant section from etc/profile
| Code: |
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH
|
What am I missing here?
Last edited by SiriusHardware on Tue Oct 30, 2012 11:22 pm; edited 1 time in total |
|
| Back to top |
|
 |
Dutch_Master LXF regular
Joined: Tue Mar 27, 2007 2:49 am Posts: 2354
|
Posted: Tue Oct 30, 2012 10:56 pm Post subject: |
|
|
There's a distinct difference between /usr and "user" (as in: the actual person using the system)... The first is a directory, storing static stuff for applications and has its roots ( ) in Unix design over 4 decades ago.
Investigate about adding paths to your profile so Bash can find them. |
|
| Back to top |
|
 |
SiriusHardware
Joined: Tue Sep 25, 2012 7:41 pm Posts: 51
|
Posted: Tue Oct 30, 2012 11:16 pm Post subject: |
|
|
| Dutch_Master wrote: | There's a distinct difference between /usr and "user" (as in: the actual person using the system)... The first is a directory, storing static stuff for applications and has its roots ( ) in Unix design over 4 decades ago.
Investigate about adding paths to your profile so Bash can find them. |
I did try, that's the only reason I ended up looking at etc/profile
Actually, I erroneously remembered the word 'usr' rather than you (now corrected in the original post, apologies for the mixup) but I seem to have done the right thing anyway - I now have home/fred/bin, into which I have copied the files as per the instructions, but BASH does not seem to see XASM there.
Ok, here's the relevant bit from the program installation instructions:
| Code: |
"For an installation for the current user only, copy the file XASM and the entire directory Xapack into the directory ~/bin . For the less experienced Linux users, the ~/bin directory is the directory /home/you/bin, where you is the user name you used during logon. If the directory ~/bin doesn't exist, create it before copying the files into it. Ubuntu will automatically add the directory ~/bin to your PATH, the next time you start a new bash shell. If your Linux/Unix version doesn't do that, include ~/bin yourself to the PATH variable in your ~/.profile file.
|
Looking at the section from /etc/profile in my previous post, do I need to add /home/fred/bin: to one of the existing PATH lines or both of them? Or do something else entirely?
Last edited by SiriusHardware on Tue Oct 30, 2012 11:29 pm; edited 1 time in total |
|
| Back to top |
|
 |
paulm LXF regular
Joined: Mon Apr 03, 2006 5:53 am Posts: 216 Location: Oxfordshire, UK
|
Posted: Tue Oct 30, 2012 11:25 pm Post subject: |
|
|
I use a ~/bin directory for my own scripts. And I make sure its in the path by adding this to my ~/.bashrc:
| Code: | if [ -d ~/bin ]; then
PATH=~/bin:$PATH
fi
|
More complicated than it really needs to be, but it checks for the existence of a bin directory in my home directory and adds it to the path if one is found.
Paul. |
|
| Back to top |
|
 |
SiriusHardware
Joined: Tue Sep 25, 2012 7:41 pm Posts: 51
|
Posted: Tue Oct 30, 2012 11:43 pm Post subject: |
|
|
| paulm wrote: | I use a ~/bin directory for my own scripts. And I make sure its in the path by adding this to my ~/.bashrc:
| Code: | if [ -d ~/bin ]; then
PATH=~/bin:$PATH
fi
|
More complicated than it really needs to be, but it checks for the existence of a bin directory in my home directory and adds it to the path if one is found.
Paul. |
OK Paul, I'll have a look in that direction, thanks. |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|