Operating System - Linux
1752661 Members
5997 Online
108788 Solutions
New Discussion юеВ

RHEL 5.3 and executable files

 
wobbe
Respected Contributor

RHEL 5.3 and executable files

I've got two scripts with the same access rights and in the same folder.
On script I can start by just entering it's name but the other only starts when I put ./ infront of it's name.
What going on here?
6 REPLIES 6
Larry Klasmier
Honored Contributor

Re: RHEL 5.3 and executable files

For the script that runs with out the ./ are you sure you are executing that script from the directory are in or is another copy of it being executed that is in your PATH?
wobbe
Respected Contributor

Re: RHEL 5.3 and executable files

I need to be in the folder that holds the scripts to start them. So no other version is started.
Michael Leu
Honored Contributor

Re: RHEL 5.3 and executable files

a) Might be a alias
alias | grep <script-that-needs-no-./>
b) or as Larry said the script is also in your $PATH
which <script-that-needs-no-./>
wobbe
Respected Contributor

Re: RHEL 5.3 and executable files

It's not an alias.
It's not in my path.
(Can't start the script from another folder)
wobbe
Respected Contributor

Re: RHEL 5.3 and executable files

"Problem" seems to be bound to the user profile. (root)
Steven Schweda
Honored Contributor

Re: RHEL 5.3 and executable files

> I've got two scripts with the same access
> rights and in the same folder.

As usual, showing actual commands (like, say
"ls -l") with their actual output can be more
helpful than vague descriptions or
interpretations.

> On script I can start by just entering it's
> name but the other only starts when I
> put ./ infront of it's name.

What, exactly, does "not start" mean to you?
As usual, showing actual commands with their
actual output can be more helpful than vague
descriptions or interpretations.

> What going on here?

You tell us? With my weak psychic powers, I
can't tell what you're doing, nor what
happened when you did it, so it's not easy to
guess why.

> It's not an alias.
> It's not in my path.

Which "it" is this?

> (Can't start the script from another folder)

What, exactly, happens when you do what,
exactly?

> "Problem" seems to be bound to the user
> profile. (root)

And what, exactly, led you to that
conclusion? Or should we be able to guess?