Hey Mark,
I was just using "./HW"
as in:
[mike@avatar mike]$ ./HW
What I gathered was if the script was in a directory, that was in my PATH, I 
could just use the name of the script instead of the whole path.
I looked in my /home/mike/.bash_profile file and it said:

[mike@avatar mike]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

Perhaps /home/mike/bin is not in the path of PATH=$PATH:$HOME/bin ?

Mike

On Wednesday 01 January 2003 03:36 pm, you wrote:
> MG wrote:
> > Hi all, This question is not really Mandrake specific although I am using
> > Mandrake8.2 (and like it alot!)...anyways trying to learn the bash shell.
> > I wrote a small script (the "Hello World" script) and named it "HW".
> > I did a "chmod 755" to it, so all could read and execute it.
> > I made a /bin directoy in my home directoy and put the script there.
> > But my problem is I can only execute it when I am in the directoy of the
> > script. I have a permission problem(I think), but cant seem to find it.
> > Any help
> > would be appreciated.
> > Here is where scipt is at:
> > /home/mike/bin/practice_script/
> >
> >
> > [mike@avatar practice_script]$ ls -al
> > total 12
> > drwxr-xr-x    2 mike     mike         4096 Dec 28 09:51 ./
> > drwxr-xr-x    3 mike     mike         4096 Dec 28 21:24 ../
> > -rwxr-xr-x    1 mike     mike           52 Dec 28 09:51 HW*
> > -rw-r--r--    1 mike     mike            0 Dec 28 09:49 HW~
> >
> > If I execute the script any where but /practice_script/ I get this
> > [mike@avatar mike]$ ./HW
> > bash: ./HW: No such file or directory
> >
> > Thanks,
> >  Mike
>
> Mike,
>
> When you call it from anywhere else except the directory where it's
> located how are you calling it? for instance...if yo're in /home/mike
> and you want to call the script you would call it this way:
>
>       bin/practice_script/HW   [enter]
>
> Is this how you're doing it?
>
> Mark

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to