From owner-freebsd-questions@FreeBSD.ORG Thu Oct 13 23:07:00 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 2A55416A41F for ; Thu, 13 Oct 2005 23:07:00 +0000 (GMT) (envelope-from drew@mykitchentable.net) Received: from relay04.roc.ny.frontiernet.net (relay04.roc.ny.frontiernet.net [66.133.182.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EB4F43D46 for ; Thu, 13 Oct 2005 23:06:59 +0000 (GMT) (envelope-from drew@mykitchentable.net) Received: from filter10.roc.ny.frontiernet.net (filter10.roc.ny.frontiernet.net [66.133.183.77]) by relay04.roc.ny.frontiernet.net (Postfix) with ESMTP id A313C359049 for ; Thu, 13 Oct 2005 23:06:58 +0000 (UTC) Received: from relay04.roc.ny.frontiernet.net ([66.133.182.167]) by filter10.roc.ny.frontiernet.net (filter10.roc.ny.frontiernet.net [66.133.183.77]) (amavisd-new, port 10024) with LMTP id 25684-03-33 for ; Thu, 13 Oct 2005 23:06:58 +0000 (UTC) Received: from blacklamb.mykitchentable.net (67-51-164-214.dsl1.elk.ca.frontiernet.net [67.51.164.214]) by relay04.roc.ny.frontiernet.net (Postfix) with ESMTP id 3467E35907C for ; Thu, 13 Oct 2005 23:06:43 +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 15055153AB4 for ; Thu, 13 Oct 2005 16:06:42 -0700 (PDT) Message-ID: <434EE80D.2010103@mykitchentable.net> Date: Thu, 13 Oct 2005 16:04:45 -0700 From: Drew Tomlinson User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: FreeBSD Questions 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 filter10.roc.ny.frontiernet.net Subject: 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: Thu, 13 Oct 2005 23:07:00 -0000 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 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: ln -s "/multimedia/Pictures/2005 Kimberly & Rich/IMG_1210.JPG" "2005 Kimberly & Rich/IMG_1210.JPG" What is the best way to manipulate this string? And then what is the right syntax for -exec? I'm an extreme newbie when it comes to shell scripting. Will this work? Are the better ways to do this than using "find". Thanks for your help, Drew -- Visit The Alchemist's Warehouse Magic Tricks, DVDs, Videos, Books, & More! http://www.alchemistswarehouse.com