From owner-freebsd-questions@FreeBSD.ORG Fri Oct 14 04:04:27 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 B5E9B16A420 for ; Fri, 14 Oct 2005 04:04:27 +0000 (GMT) (envelope-from pauls@utdallas.edu) Received: from mail.stovebolt.com (mail.stovebolt.com [66.221.101.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6537043D45 for ; Fri, 14 Oct 2005 04:04:27 +0000 (GMT) (envelope-from pauls@utdallas.edu) Received: from [192.168.2.101] (adsl-66-141-176-116.dsl.rcsntx.swbell.net [66.141.176.116]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.stovebolt.com (Postfix) with ESMTP id 5C03711431A for ; Thu, 13 Oct 2005 23:05:48 -0500 (CDT) Date: Thu, 13 Oct 2005 23:03:52 -0500 From: Paul Schmehl To: FreeBSD Questions Message-ID: <0D55CDDCD0D6445B3FF1FA6B@Paul-Schmehls-Computer.local> In-Reply-To: <434EE80D.2010103@mykitchentable.net> References: <434EE80D.2010103@mykitchentable.net> X-Mailer: Mulberry/4.0.0 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: sh Scripting - String Manipulation X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Paul Schmehl List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2005 04:04:27 -0000 --On October 13, 2005 4:04:45 PM -0700 Drew Tomlinson 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/