Associate program with extension

Dan Trainor - hostinthebox.net info at hostinthebox.net
Sun Oct 24 06:23:09 UTC 2004


Barry -

Most scripts that are worth their own code have a specification on the 
very first line that tells the shell which program to "associate" or 
interpret the code with.

head myfile.pl

will show you that line, at the top.  More often than not, there is no 
"association", as Linux does not care about extensions for the mostpart, 
and when it does, then you're kindof in a new level there.

Play around with what I had mentioned, perhaps you'll get a better 
understanding of how it works.

Heck, rename the file from myprogram.pl to this.is.a.cool.program, and run:

./this.is.a.cool.program

As long as the script has an executable bit associated with it, and has 
a command interpreter specification inside of it, it will run, in most 
cases.

I'm running low on sleep, so that entire message probably sounds 
retarded.  I'll be back tomorrow after I read it agagin and go "what the 
heck was I thinking?".

Thanks
-dant



Barry Bourdage wrote:

> Hello All,
>  Somehow I changed the ability to execute perl scripts by typing in
> ./xxx.pl I now have to type perl xxx.pl
> 
> How do you associate the file that runs when you try ./ and a file with
> an extension.
> 
> Thank you
> 
> Barry
> 




More information about the fedora-list mailing list