From owner-freebsd-questions@FreeBSD.ORG Thu Sep 9 17:46:58 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DC1010656CC for ; Thu, 9 Sep 2010 17:46:58 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 115DE8FC24 for ; Thu, 9 Sep 2010 17:46:57 +0000 (UTC) Received: by yxn35 with SMTP id 35so855754yxn.13 for ; Thu, 09 Sep 2010 10:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=Y8f80BcuHffyNQ/wmH9ar3KYy0gyuW4bA0sOER8E0WE=; b=vYdkOtMmQocInZxnkXcPgKJ+/T+QYqs3DxcLBraDopb79au9ohZCWEfX2Z69e9U+Mb LOW6r1brpNnrYG0D4zgKgUIhsl6lWmlwp6thAkCDffBpbnnY3p+aiGzV78j0szex0x7+ W48hiAWpVs9BYpJcsx9EWKLsbiTx49wHR+Kf4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=T1W/rgwsqQ33JQ0k/MK24LOdWAqmJv2JgJ5jXO2wmb44rkUF6AvmI+krg1jAhieOwg j7cesC6BIJMm4rc/4auIiTyJD/oXBw4Ixr69jB0+GCUaGQbLKeJSyRNf59QZW9fXjknD TEguUXYn8GFAOcCEmoA3mLTCi9hElOSKjq9PQ= MIME-Version: 1.0 Received: by 10.151.114.20 with SMTP id r20mr467664ybm.197.1284053090712; Thu, 09 Sep 2010 10:24:50 -0700 (PDT) Received: by 10.231.184.223 with HTTP; Thu, 9 Sep 2010 10:24:50 -0700 (PDT) Date: Thu, 9 Sep 2010 13:24:50 -0400 Message-ID: From: Aryeh Friedman To: FreeBSD Mailing List Content-Type: text/plain; charset=ISO-8859-1 Subject: how to recursively symlink every file in a dir 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, 09 Sep 2010 17:46:58 -0000 I want to make it so every file is a seperate symlink in dir2 if and only if it is a regular file (not a dir) in dir1... the reason is if the file is unchanged then use symlink but I can rm the symlink and replace it with a non-symlink: To show the problem I am attempting to solve: foo: (owned by fred) arf: ack in barney's account: ln -s ~foo/ foo rm foo/arf/ack # Permissioin denied ... it should nuke the symlink and let me then do something like "touch foo/arf/ack Note there are over 500 files upto 5 dirs deep in the dir I want to symlink from.... the final application is our version control system (devel/aegis) keeps seperate repos for different source code projects (for obvious reasons) and we want to make it so in normal operation we can symlink tne source tree from one project into an other but if we want to make a local modificiation to the "foreign" source tree all we have do is (sorry for the aegis commands but I think the idea is clear): rm src/foreign/foo.c aenf src/foreign/foo.c cp ~aegis/foreign/baselins/src/forgein.c vi src/foreign/foo.c # to make local modifications And before someone suggests a ar library we purposely *DO NOT* want the modified libs to be installed until later