Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!genrad!decvax!ima!bbn!aoa!chuckles From: chuckles@aoa.UUCP (Charles Stern) Newsgroups: comp.unix.questions Subject: Re: A couple questions Message-ID: <21@aoa.UUCP> Date: Wed, 22-Apr-87 14:02:06 EST Article-I.D.: aoa.21 Posted: Wed Apr 22 14:02:06 1987 Date-Received: Sat, 25-Apr-87 09:23:14 EST References: <3164@jade.BERKELEY.EDU> <2382@ncoast.UUCP> Reply-To: chuckles@aoa.UUCP (Charles Stern) Followup-To: <2382@ncoast.UUCP> Organization: Adaptive Optics Assoc., Cambridge, Mass. USA Lines: 44 Summary: Not truly correct... In article <2382@ncoast.UUCP> robertd@ncoast.UUCP (Rob DeMarco) writes: >>Hello! I've a couple of questions in UNIX 4.2. >> >>1. How do programs like "more" distinguish between text files and >> executable files? Hopefully, there's something surer than >> just taking a sample of a file and testing it. (This question >> came up when a bunch of people started accidentally sending >> executables to a line printer, and I was trying to figure >> out a way to filter out the execs from the texts). > > I would believe that a pretty sure >method would be to test the file >permisions, if an "x" accours in the >file permisions, then it is executable, >other wise its text. This is not truly accurate. Consider the case of an executable shell script... more SURELY works on that! (thank G-d ;-)) >>Thanks for your time, > Your welcome! :-) >> Marc M. Pack > > >-- >[=====================================] >[ Rob DeMarco ] >[ UUCP:decvax!cwruecmp!ncoast!robertd ] >[ ] >[ "bus error - passengers dumped" ] >[=====================================] -- Charles Stern ...!{decvax,linus,ima,ihnp4}!bbncca!aoa!chuckles ...!{wjh12,mit-vax}!biomed!aoa!chuckles "What's black and dangerous and sits in a tree?" "A crow with a machine gun." -- "Star Smashers of the Galaxy Rangers" Harry Harrison