Re: [flalug] Re: 1st post

From: Eben King (eben1@tampabay.rr.com)
Date: Fri Feb 18 2005 - 17:48:24 EST


On Fri, 18 Feb 2005, Khepri wrote:

> Eben King wrote:
>
> >>Investigating it a bit it seems that the major
> >>difference is perl scripts can be executable?
> >
> > Lost the thread. The difference between perl scripts and what?
>
> PHP I think it was....
>
> PHP cannot be compiled into an executable whereas
> Perl can...I think that was what I was wondering?

Possibly. Compiled things generally run much faster than interpreted
things.

> > But anyway, in Un*x, any file can be executable.
>
> !? ...:)

Well, _marked_ executable. If you make an MP3 executable, you can run it
but it'll just bomb.

> > If the user asks to run a particular file (usually by typing its name),
> > it's up to the OS to figure out how to run it. It looks to see if the
> > first two characters are "#!". If they are, the OS treats the rest on
> > the line as an interpreter (so the file is a script -- perl, bash,
> > expect, or what-have-you) and feeds the file to it.
>
> Hmmm. Slightly confused now...:) A good thing.
> This must be one of those grey areas....
>
> So, is there any easy way to tell which files are
> binary and which are ascii?

"file somefile"

"grep somestring somefile" will say if it finds a hit ("Binary file
/export/media/backgrounds/birds_in_flight.jpg matches") but it's unreliable
and inefficient.

Other programs might say, but "file" is the "right" way.

> I notice in this
> microdistro tht the Perl scripts are listed as
> executbles as indicated by their color (ansi I guess)

Probably not because they're Perl scripts, but because they're executable.
You can make a Perl script non-executable ("chmod a-x some_script"), and
then it'd look just like any other file, and you'd have to run it as "perl
somescript".

-- 
-eben    ebQenW1@EtaRmpTabYayU.rIr.OcoPm    home.tampabay.rr.com/hactar

"You're one of those condescending Unix computer users!" "Here's a nickel, kid. Get yourself a better computer" - Dilbert.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:39:20 EDT