Date: Fri, 14 Oct 2005 08:42:17 -0700 From: Drew Tomlinson <drew@mykitchentable.net> To: Kirk Strauser <kirk@strauser.com> Cc: freebsd-questions@freebsd.org Subject: Re: sh Scripting - String Manipulation Message-ID: <434FD1D9.4070703@mykitchentable.net> In-Reply-To: <200510132043.06169.kirk@strauser.com> References: <434EE80D.2010103@mykitchentable.net> <200510132043.06169.kirk@strauser.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10/13/2005 6:43 PM Kirk Strauser wrote: >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. > > Thanks for your reply. This is a good workaround in this particular situation for getting it done quickly. However I hope to learn how to actually manipulate the string for future reference. I've done some reading and played with awk and sed a little but I can't get either to behave as I expect. If awk and/or sed seem to be the best solution, I'll post again with specific questions. Thanks, Drew -- Visit The Alchemist's Warehouse Magic Tricks, DVDs, Videos, Books, & More! http://www.alchemistswarehouse.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?434FD1D9.4070703>