Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!lll-lcc!well!daniels From: daniels@well.UUCP Newsgroups: comp.unix.questions Subject: Thanks for the awk help! Message-ID: <3992@well.UUCP> Date: Sun, 20-Sep-87 21:25:02 EDT Article-I.D.: well.3992 Posted: Sun Sep 20 21:25:02 1987 Date-Received: Tue, 22-Sep-87 01:20:34 EDT Reply-To: daniels@well.UUCP (Dan Smith, Social Mammal...) Distribution: na Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 39 Thanks to all who sent me suggestions concerning awk. It appears that the documentation is, uh, how shall we say... less than perfect. After 4 1/2 years of Unix, I should remember to take unix docs with a grain of rock salt :-) The solution to my problem seems to be that of having a shell script doing some pre-processing. A new question! I'm coming up with fast ways of determining all of the file name extensions in a directory. (this is in a csh script) The problem is, csh doesn't have a fast way of telling you that an element in a variable is just a basename (let's say $a was set from "set a=*", and you are looking for basename only files such as "Makefile", or "readme"). It would be good for csh to have a :b modifier... you could say "echo $a:gb" to get basename only files. The fastest way so far that I've come up with is: set bnames="" set tmp=$a while ($#tmp) if ($tmp[1]:r == $tmp[1]) then set bnames=($bnames $tmp[1]) endif shift tmp end I'm trying to avoid going into a loop, since most of the stuff I deal with might have directories with 20-200 files, and only 2 or 3 of those files are basename only. Sure this works, but I'm looking for more speed (I'll eventually rewrite a lot of this in C, but I'm quickly protyping some ideas in csh) Any ideas? dan smith dan smith, island graphics, marin co., ca | "I am responsible for everything uucp: ..!ucbvax!ucbcad!well!island!daniel | I've ever said since 1960!" uucp: ..!ptsfa!unicom!daniel !well!daniels | (415) 892 TANK (h) 491 1000 (w)