[Liverpool] batch-edit symlinks

Daniel Hulme lpool-lug at istic.org
Fri Mar 2 20:24:43 GMT 2007


I have on my filesystem a load of absolute symlinks that were generated
by a script. They are of the form

/some/path/17/23.jpeg -> /mnt/foo/bar/baz.jpeg

where the values of '17', '23', 'bar', and 'baz' vary. I have moved all
the targeted files from /mnt/foo to somewhere else, and I want to update
all the symlinks, of which there are several hundred, all with small
integer filenames, in small integer directories. There are some other
files in those directories which must remain untouched.

To put it another way, I have a directory whose subdirectories contain
symlinks all pointing to files under some second directory. For each of
those symlinks, I want to replace the absolute path to that second
directory with the path to a third directory. I want it to take less
than o(n) effort on my part.

There must be an existing utility for this, but I can't seem to find the
right search terms for Google. Has anyone on the list previously solved
this problem? If not I will have to write a script to do it, which is
more effort than I was hoping to have to use.

Thanks for any help anyone can give.

-- 
Hats are no worse for being made by ancient hatters, and good butter can
be bought in a shop that has no jazz-band.  -- J.B. Morton (Beachcomber)
P.S. --- Tell  Saunders that he  must not leave cat's  meat on  my desk.
http://surreal.istic.org/ old-fashioned quality within the McQuary limit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/liverpool/attachments/20070302/86a65882/attachment.bin


More information about the Liverpool mailing list