Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site uw-beaver Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!schwartz From: schwartz@uw-beaver (Michael Schwartz) Newsgroups: net.sources Subject: csh script to find outdated symbolic links Message-ID: <1723@uw-beaver> Date: Thu, 21-Nov-85 21:55:58 EST Article-I.D.: uw-beave.1723 Posted: Thu Nov 21 21:55:58 1985 Date-Received: Sat, 23-Nov-85 06:10:09 EST Distribution: net Organization: U of Washington Computer Science Lines: 56 Here is a csh script to find outdated symbolic links. To my knowledge, symbolic links are only available on 4.2BSD and 4.3BSD, so this script is useless to people on other systems. It is useful to run this script after moving files or directories around, because you may have symbolic links to these files/directories that become outdated after the move. Usage: oldlinks [, ...] Output: names of symbolic links (stored in the specified directory hierarchies) which are outdated, if any. - Mike Schwartz University of Washington Computer Science Department ihnp4!uw-beaver!schwartz (USENET) schwartz@wally.arpa (ARPANET) schwartz%wally.arpa@csnet-relay.arpa (CSNET) # This is a shell archive. # Remove everything above and including the cut line. # Then run the rest of the file through sh. #-----cut here-----cut here-----cut here-----cut here----- #!/bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # oldlinks # This archive created: Thu Nov 21 18:43:14 1985 echo shar: extracting oldlinks '(595 characters)' sed 's/^XX//' << \SHAR_EOF > oldlinks XX#!/bin/csh -f XX# csh script to find and print outdated symbolic links, searching XX# (recursively) downwards into the specified directories. XX# By Mike Schwartz, 11-20-85. XX# University of Washington Computer Science Department XX# ihnp4!uw-beaver!schwartz (USENET) XX# schwartz@wally.arpa (ARPANET) XX# schwartz%wally.arpa@csnet-relay.arpa (CSNET) XX XXif $#argv == 0 then XX echo Usage: oldlinks \ \[\, ...\] XX exit 1 XXendif XXforeach i($*) XX find $i -type l -print | sed 's/\(.*\)/if !(-e \1) echo \1/' > /tmp/tstlinks.$USER XX source /tmp/tstlinks.$USER XXend XX XXrm /tmp/tstlinks.$USER SHAR_EOF if test 595 -ne "`wc -c oldlinks`" then echo shar: error transmitting oldlinks '(should have been 595 characters)' fi chmod +x oldlinks # End of shell archive exit 0