sh Scripting - String Manipulation

Kirk Strauser kirk at strauser.com
Thu Oct 13 18:43:10 PDT 2005


On Thursday 13 October 2005 06:04 pm, Drew Tomlinson wrote:

> What I'd like to is get '-exec' to run this command:
>
> ln -s "/multimedia/Pictures/2005 Kimberly & Rich/IMG_1210.JPG" "2005
> Kimberly & Rich/IMG_1210.JPG"

The easiest way I've found is to simply change into /multimedia/Pictures 
before running find, then refer "ln" back to your original directory.

Say that you want the links to be made inside /home/drew .  Instead of running 
find from their, do:

    $ cd /multimedia/Pictures
    $ find -iname '*.jpg' -exec ln -s {} /home/drew

There - you've removed any need for string manipulation with a simple cd.
-- 
Kirk Strauser
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20051013/739c6802/attachment.bin


More information about the freebsd-questions mailing list