5 # $RCSfile: relink,v $$Revision: 4.1 $$Date: 92/08/07 17:20:29 $
9 ($op = shift) || die "Usage: relink perlexpr [filenames]\n";
15 next unless -l; # symbolic link?
26 ##############################################################################
28 # These next few lines are legal in both Perl and nroff.
32 'di \" finish diversion--previous line must be blank
33 .nr nl 0-1 \" fake up transition to first page again
34 .nr % 0 \" start at page 1
35 ';<<'.ex'; #__END__ ############# From here on it's a standard manual page ############
36 .TH RELINK 1 "July 30, 1990"
39 relink \- relinks multiple symbolic links
41 .B relink perlexpr [symlinknames]
44 relinks the symbolic links given according to the rule specified as the
46 The argument is a Perl expression which is expected to modify the $_
47 string in Perl for at least some of the names specified.
48 For each symbolic link named on the command line, the Perl expression
49 will be executed on the contents of the symbolic link with that name.
50 If a given symbolic link's contents is not modified by the expression,
51 it will not be changed.
52 If a name given on the command line is not a symbolic link, it will be ignored.
53 If no names are given on the command line, names will be read
56 For example, to relink all symbolic links in the current directory
57 pointing to somewhere in X11R3 so that they point to X11R4, you might say
60 relink 's/X11R3/X11R4/' *
63 To change all occurences of links in the system from /usr/spool to /var/spool,
67 find / -type l -print | relink 's#/usr/spool#/var/spool#'
71 No environment variables are used.
80 If you give an invalid Perl expression you'll get a syntax error.