On 6/13/05, Rob Becker [email protected] wrote:
I have a bunch of oggs in a partition called autotunes that are organized into directories by artist and then subdirectories by album.
I need to have a symbolic link for each ogg appear in the /autotunes directory. I can get a list of all the oggs by just using locate *.ogg. Others are much more qualified to answer this but here are my thoughts.
locate will return the file name. find will return the file name and the realative path example: find /music/oggfiles -iname '*.ogg' #all ogg files under /music/oggfiles
I would do something like: ++++++++++++++++++++++++++++++++++ #!/bin/sh cd /music/oggfles
for i in `find ./ -iname '*.ogg'` # note use of backtics do echo "working with $i" filename=`echo $i |sed 's/^.*///'` #strip the path echo "filename $filename" #make symbolic link in this directory ln -s $i $filename #lmake symb. links. done
+++++++++++++++++++++++++++++++++++++++++++++
Best of luck