Recursive symbolic linking question
rod
crimson.blue.2 at gmail.com
Mon Jun 13 21:43:18 CDT 2005
On 6/13/05, Rob Becker <rbecker at kcai.edu> 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
More information about the Kclug
mailing list