[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Association program

> Yes, file(1):
>        file - determine file type
>        file  [ -vczL ] [ -f namefile ] [ -m magicfiles ] file ...
>        This manual page documents version 3.20.1 of the file com=AD
>        mand.   File tests each argument in an attempt to classify
>        it.  There are three sets  of  tests,  performed  in  this
>        order:  filesystem tests, magic number tests, and language
>        tests.  The first test that succeeds causes the file  type
>        to be printed.
>        The  type  printed  will  usually contain one of the words
>        text (the file contains only ASCII characters and is prob=AD
>        ably  safe  to read on an ASCII terminal), executable (the
>        file contains the result of compiling a program in a  form
>        understandable  to  some  UNIX kernel or another), or data
>        meaning anything else (data is usually  `binary'  or  non-
>        printable).   Exceptions are well-known file formats
> [...]
> e.g:
> (david@eos) ~$file TeX/bofh.texi =
> TeX/bofh.texi: Texinfo source text
> David


OOPS!! Let me make my objective and reasoning clearer.. I maintain my 
office intranet website. When I write the html code or a cgi script,
and check it out, I have to type lynx a.html or perl a.cgi. I thought 
it would be really nice if I typed a.cgi, it would automatically 
convert it into perl a.cgi for one user and vi a.cgi for another user. 
So I did not want to depend on system wide settings. I still cannot 
figure out how file would tell me difference between a 'C' program and 
a 'perl' program..

So my original question still holds..Is there any way I can capture 
the user input before the shell gets it ? or should I modify a shell ?


Reply to: