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