Execute file without extension

Hi,

I have some perl script with names like abc.pl etc. I am Solaris 9 and i am not able to run "abc", either I have to do perl abc.pl OR ./abc.pl.

Could you someone provide me an insight or reference on this. So that I can understand the basic, and apply it for my purpose.

Thanks John.

what error you are getting ?

Does your file has execute permissions ?

It is giving me following error :

bash: lgrep: command not found

I can think of adding this command in my Env. Could you anyone point me to right link for this? Will this be a good option?

  • John.

It's a classic PATH problem.
Let's assume your perl file is in folder /abc/xyz
Update your PATH this way:

PATH=$PATH:/abc/xyz
export PATH

If you want this command for yourself update the PATH in your .profile file

Unlike DOS/windows, your current working directory is not part of your path unless you specifically modify your PATH environmental variable to include it.

I can see that i have other values, will running the above specified command, will clear out existing value.

I would like to run on root profile, just wanted to make sure it is safe to run.

PATH=/opt/ldap/sparc64/3.3.11:/opt/ldap/sparc64/4.5.20:/usr/bin:/usr/local/bin
_=/usr/bin/env

Thanks for help, i just ran the above command, and it updated the path. I got what I wanted.

I have one more questions, let's say I have two scripts with the same name ( one comes with installation, other one is manually created ). Now, Let's say i added both the path in ENV.

What will happen if I run the command, which one will be run by default? Is there anyway to make one path as default.

The intention is to make manual file as default.

Thanks, John.