lori@hacgate.UUCP (Lori Barfield) (12/12/89)
No one yelled "stop!" so here's another: One of the problems with Aegis (9.7 at least) is that links going nowhere collect on your disk over the ages until things get really messy. Here is a simple script to list and check every link for a given dir. I used it like "ck_link //newton..." to periodically clean up an entire disk. By default, it will check just the links in the working directory-- an option I used to verify a link or set of links I had just created. ---------------------------------- cut here ------------------------------ # CK_LINK # checks link resolution names for existence # needed because crl command doesn't warn if unresolvable # 1 opt arg- pathname to check (CL processing available) # NOTE: to check all dirs at and below a given level, use 'TOPDIR...' # NOTE: for large checks, redirect output to a file and search on 'ERROR' # default-- check all links in current dir # eon # if eqs ^1 then path := '.' else path := ^1 endif found := false args '' # /com/ld -lt -ll -c ^path | @ while read link resolution do if existf ((^resolution - '"' - '"')) then args " @"^link@" points to ^resolution" else args "ERROR: no resolution ^resolution for link @"^link@"" endif if ((not ^found)) then found := true endif enddo # if ((^found)) then args '' "Link check completed." '' else args 'No links found.' endif