Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2005 23:03:52 -0500
From:      Paul Schmehl <pauls@utdallas.edu>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: sh Scripting - String Manipulation
Message-ID:  <0D55CDDCD0D6445B3FF1FA6B@Paul-Schmehls-Computer.local>
In-Reply-To: <434EE80D.2010103@mykitchentable.net>
References:  <434EE80D.2010103@mykitchentable.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--On October 13, 2005 4:04:45 PM -0700 Drew Tomlinson 
<drew@mykitchentable.net> wrote:

> I'm working on a script that reads a directory using 'find' and its
> '-exec' primary to create a symlink to the file.  So for example, I have
> the following command:
>
find /multimedia/Pictures -iname "*.jpg" -print | cut -d'/' -f4

You'll have to play with the field value (-f) to get the right location, 
but this would return only the filename.
>
> This command returns a bunch of filenames.  Here's an example of one:
>
> /multimedia/Pictures/2005 Kimberly & Rich/IMG_1210.JPG
>
> What I'd like to is get '-exec' to run this command:
>
I don't understand what you're trying to do here.

> ln -s "/multimedia/Pictures/2005 Kimberly & Rich/IMG_1210.JPG" "2005
> Kimberly & Rich/IMG_1210.JPG"
>
Are you trying to create symlinks in a different directory?  If so, why not 
do this?

ln -s dir1/ dir2/

Then, when you add new files to dir1/ they will automatically show up in 
dir2/ because the dir is symlinked rather than the individual files.

What exactly are you trying to accomplish?

Paul Schmehl (pauls@utdallas.edu)
Adjunct Information Security Officer
University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0D55CDDCD0D6445B3FF1FA6B>