Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!sdd.hp.com!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!lobster!sugar!peter From: peter@sugar.hackercorp.com (Peter da Silva) Newsgroups: comp.sys.amiga.advocacy Subject: Re: Script bits Message-ID: <1991Feb13.210019.3896@sugar.hackercorp.com> Date: 13 Feb 91 21:00:19 GMT References: <18ac1a05.ARN2ae4@prolix.pub.uu.oz.au> <1991Feb13.013917.22130@sugar.hackercorp.com> <1991Feb13.053854.12419@mintaka.lcs.mit.edu> Organization: Sugar Land Unix -- Houston, TX Lines: 45 In article <1991Feb13.053854.12419@mintaka.lcs.mit.edu> rjc@geech.ai.mit.edu (Ray Cromwell) writes: > It's neat if I can type ls -F, and the listing will show which files > are executable, links, directories, data, and script. I'm afriad open()ing or > LoadSeg()ing every file in a tree will be quite slow. True, but you could see which ones are "executable or script". And, really, you probably don't care which is which. That's the whole point of the script bit, after all... > Hey, you use dterm? I think matt dillion stopped working on that a > long time ago? My version is buggy! (GURUs often) Yep, I use Dterm. It's still the best plain-jane terminal program (no fancy emulations... just a solid window on the WB). I have V 1.11 and it doesn't GURU on me... Wish I could talk Matt into supporting DTERM again. It's a good program. > How do we tell the difference between Arexx scripts, shell scripts, > CSH scripts, TCL scripts, etc? That's a Small Matter of Programming in "load_script()". Personally, I like the idea of using the Filenote for this (that'd satisfy your "ls" needs)... Actually, do this: fp = fopen(filename, "r"); fgets(firstline, sizeof firstline, fp); fclose(fp); hashbang = strstr(firstline, "#!"); if(!hashbang) shell_script(filename); else { sprintf(cmd, "%s %s", hashbang+2, filename); System(cmd, ...); } You could also have the #! string in the filenote (check that first, for speed). > I kind of like the .info scheme Also a good idea... -- Peter da Silva. `-_-' .