[linux-audio-user] batch creation of symlinks

Florian Paul Schmidt mista.tapas at gmx.net
Sun Jul 9 13:10:16 EDT 2006


On Sun, 9 Jul 2006 11:17:21 +0200
Frank Barknecht <fbar at footils.org> wrote:

> Hallo,
> Hans hat gesagt: // Hans wrote:
> 
> > in the subdir, or
> > 
> > for i in ./dir1/*.mp3; do ln -s $i $i;done
> 
> Almost, but you're trying to link a file on itself here ("$i->$i").
> Use this instead:
> 
> $ for i in ./dir1/*.mp3; do ln -s $i . ;done
> 
> or even more general: 
> 
> $ for i in */* ; do ln -s $i . ; done

Watch out for whitespaces though. If your filenames can contain spaces,
it might be wise to do 

export IFS=$'\n'$'\t'

and then do your for-loop. Don't forget to change it back afterwards
though.

Flo


-- 
Palimm Palimm!
http://tapas.affenbande.org



More information about the Linux-audio-user mailing list