Click to See Complete Forum and Search --> : the bin-dir in my $home: it's there but it's not there *?*


Ludootje
11-08-2001, 04:43 PM
i'm (trying :D) to make some bashscripts, and to launch them without putting ./ before the name, i have to put them in $HOME/bin (in my case: /home/ludo/bin)
so i typed:
mkdir bin
mv scriptname /home/ludo/bin
no errors until that
cd bin
BASH: cd: bin: unknown file or dir
*?*
mkdir bin
mkdir: 'bin' exists but it's not a directory
:confused: :confused: :confused:
anyone an idea?
and when - with gmc - i search for that dir in /home/ludo, it's not there, when i want to cd to /home/ludo/bin, it doesn't exist.. :/
anyone knows why?

X_console
11-08-2001, 04:58 PM
What happens when you type ls -l ~
Do you see it there? What happens when you type file ~/bin

I think what's happened is that when you did mv scriptname /home/ludo/bin you overwrote bin with scriptname. Of course the only way this could have happened is if bin wasn't a directory in the first place.

DMR
11-08-2001, 09:39 PM
You were in the /home/ludo directory when you typed all of this, right?

Linuxcool
11-09-2001, 03:20 AM
I believe that I know what happened.

When you ran the command mkdir bin, you weren't in the /home/ludo directory. You were in the directory where your script file is located. So, you created the directory bin in that directory.

Running the command mv scriptname /home/ludo/bin moved your script file into the directory /home/ludo and renamed it bin . That's why you get the error about bin being an unknown file or directory.

What you need to do is move your script file back to its original directory and delete the bin directory in the script file's directory. Then run mkdir /home/ludo/bin and then move your script file into the new bin directory.

I hope I got that right. :)

Ludootje
11-09-2001, 12:12 PM
Originally posted by X_console:
<STRONG>What happens when you type ls -l ~
Do you see it there? What happens when you type file ~/bin

I think what's happened is that when you did mv scriptname /home/ludo/bin you overwrote bin with scriptname. Of course the only way this could have happened is if bin wasn't a directory in the first place.</STRONG>

i think you're right, cause when i type "ls -l ~" i see it, but it's a file, not a dir.. tnx, i'll just remove it and make that dir with gmc, so i'm sure it'll work

When you ran the command mkdir bin, you weren't in the /home/ludo directory. You were in the directory where your script file is located. So, you created the directory bin in that directory.

heh, the dir where my script was in, is my /home/ludo ;) - but for the rest you're right


tnx for the help everyone
( why did they let the "mv" cmd do 2 operations :rolleyes: )

Ludootje

[ 11 November 2001: Message edited by: Ludootje ]

Ludootje
11-09-2001, 12:15 PM
it's working fine now, i don't have to type that ./blabla anymore now..