5 # $RCSfile: relink,v $$Revision: 4.1 $$Date: 92/08/07 17:20:29 $
8 # Revision 4.1 92/08/07 17:20:29 lwall
11 # Revision 4.0 91/03/20 01:11:40 lwall
14 # Revision 3.0.1.2 90/08/09 03:17:44 lwall
15 # patch19: added man page for relink and rename
18 ($op = shift) || die "Usage: relink perlexpr [filenames]\n";
24 next unless -l; # symbolic link?
35 ##############################################################################
37 # These next few lines are legal in both Perl and nroff.
41 'di \" finish diversion--previous line must be blank
42 .nr nl 0-1 \" fake up transition to first page again
43 .nr % 0 \" start at page 1
44 ';<<'.ex'; #__END__ ############# From here on it's a standard manual page ############
45 .TH RELINK 1 "July 30, 1990"
48 relink \- relinks multiple symbolic links
50 .B relink perlexpr [symlinknames]
53 relinks the symbolic links given according to the rule specified as the
55 The argument is a Perl expression which is expected to modify the $_
56 string in Perl for at least some of the names specified.
57 For each symbolic link named on the command line, the Perl expression
58 will be executed on the contents of the symbolic link with that name.
59 If a given symbolic link's contents is not modified by the expression,
60 it will not be changed.
61 If a name given on the command line is not a symbolic link, it will be ignored.
62 If no names are given on the command line, names will be read
65 For example, to relink all symbolic links in the current directory
66 pointing to somewhere in X11R3 so that they point to X11R4, you might say
69 relink 's/X11R3/X11R4/' *
72 To change all occurences of links in the system from /usr/spool to /var/spool,
76 find / -type l -print | relink 's#/usr/spool#/var/spool#'
80 No environment variables are used.
89 If you give an invalid Perl expression you'll get a syntax error.