From owner-freebsd-questions@FreeBSD.ORG Fri Oct 14 15:44:36 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C5EAA16A41F for ; Fri, 14 Oct 2005 15:44:36 +0000 (GMT) (envelope-from drew@mykitchentable.net) Received: from relay02.roc.ny.frontiernet.net (relay02.roc.ny.frontiernet.net [66.133.182.165]) by mx1.FreeBSD.org (Postfix) with ESMTP id 439CA43D48 for ; Fri, 14 Oct 2005 15:44:36 +0000 (GMT) (envelope-from drew@mykitchentable.net) Received: from filter05.roc.ny.frontiernet.net (filter05.roc.ny.frontiernet.net [66.133.183.72]) by relay02.roc.ny.frontiernet.net (Postfix) with ESMTP id CE92137062D; Fri, 14 Oct 2005 15:44:35 +0000 (UTC) Received: from relay02.roc.ny.frontiernet.net ([66.133.182.165]) by filter05.roc.ny.frontiernet.net (filter05.roc.ny.frontiernet.net [66.133.183.72]) (amavisd-new, port 10024) with LMTP id 04922-06-99; Fri, 14 Oct 2005 15:44:35 +0000 (UTC) Received: from blacklamb.mykitchentable.net (67-51-164-214.dsl1.elk.ca.frontiernet.net [67.51.164.214]) by relay02.roc.ny.frontiernet.net (Postfix) with ESMTP id 1DC6537057C; Fri, 14 Oct 2005 15:44:13 +0000 (UTC) Received: from [165.107.42.123] (unknown [165.107.42.123]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by blacklamb.mykitchentable.net (Postfix) with ESMTP id 32FE01549FC; Fri, 14 Oct 2005 08:44:12 -0700 (PDT) Message-ID: <434FD1D9.4070703@mykitchentable.net> Date: Fri, 14 Oct 2005 08:42:17 -0700 From: Drew Tomlinson User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kirk Strauser References: <434EE80D.2010103@mykitchentable.net> <200510132043.06169.kirk@strauser.com> In-Reply-To: <200510132043.06169.kirk@strauser.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-2.3.2 (20050629) at filter05.roc.ny.frontiernet.net Cc: freebsd-questions@freebsd.org Subject: Re: sh Scripting - String Manipulation X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2005 15:44:36 -0000 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