#!/usr/bin/ruby #### betterlinks file was created with : #### symlinks -v -r . | awk '{print $2,$4}' > betterlinks #### doSed.pl betterlinks /usr/www/core /web/sites/core #### doSed.pl betterlinks /usr/www/bborder /web/sites/blackborder #### doSed.pl betterlinks /usr/www/adventureson /web/sites/adventureson #### doSed.pl betterlinks /usr/web/bborder /web/sites/blackborder # #### for each line in the file, relink the first file to the second, eg: #### nat1683:# ln -sf /web/sites/core/etc/cron/corecron /web/sites/adventureson/etc/cron/corecron #### where the command could be ln -sf $2, $1 if awk were involved somehow @better = File.open('betterlinks').readlines @better.each do |line| @one,@two = line.split `ln -sf #{@two} #{@one}`#; echo linked #{@one} -> #{@two}` end