Need BASH script help

Joel Oliver joelol75 at verizon.net
Thu May 15 12:32:10 UTC 2008


Jared Greenwald wrote:
> Something like this?  I always remember the ln format by using real
> and fake hence the var names.
>
> cd /big/sda
> find Sorted -type l -name "*avi" | while read fake ; do
>   real="../../../moviesa/"${fake##*/}
>   ln -svf $real $fake
> done
>
> I make no guarantee that it will work, just a suggestion.  You should
> probably replace the ln line with 'echo "$real::$fake"' and run that
> once to make sure that its going to be doing what you want.
>
> On Wed, May 14, 2008 at 8:25 PM, Joel Oliver <joelol75 at verizon.net> wrote:
>   
Thanks!  Got it to work finally... The big problem I had was with 
spaces... It was chopping off anything before the space so the link 
failed.... BTW here's what worked a charm:


#!/bin/bash
cd /big/sda1
find Sorted -type l -name "*avi" | while read fake ; do
  real="../../../moviesa/"${fake##*/}""
  ln -svf "$real" "$fake"
done



Thanks a million!




More information about the kubuntu-users mailing list