From owner-freebsd-questions@FreeBSD.ORG Tue Dec 5 15:57:13 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12B1116A412 for ; Tue, 5 Dec 2006 15:57:13 +0000 (UTC) (envelope-from martijn@hostage.nl) Received: from mail.hostage.nl (mail.hostage.nl [84.244.181.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5E6D43CA2 for ; Tue, 5 Dec 2006 15:56:32 +0000 (GMT) (envelope-from martijn@hostage.nl) Received: from mx1.hostage.nl (mail.hostage.nl [84.244.181.16]) by mail.hostage.nl (Postfix) with ESMTP id 44F2625C22D for ; Tue, 5 Dec 2006 16:57:08 +0100 (CET) X-Virus-Scanned: by Hostage Received: from mail.hostage.nl ([84.244.181.16]) by mx1.hostage.nl (mail.hostage.nl [84.244.181.16]) (amavisd-new, port 10024) with ESMTP id NzgPfdR25YRp for ; Tue, 5 Dec 2006 16:57:08 +0100 (CET) Received: from www.hostage.nl (home.pacno.net [194.109.221.19]) by mail.hostage.nl (Postfix) with ESMTP id 05EF425C130 for ; Tue, 5 Dec 2006 16:57:08 +0100 (CET) Received: by www.hostage.nl (Postfix, from userid 1001) id BA4B410B09B; Tue, 5 Dec 2006 16:57:01 +0100 (CET) Date: Tue, 5 Dec 2006 16:57:01 +0100 From: martijn To: freebsd-questions@freebsd.org Message-ID: <20061205155701.GA20751@scratch.home.pacno.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.12-2006-07-14 Subject: help! directories changed into regular files! :( 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: Tue, 05 Dec 2006 15:57:13 -0000 Hi, I remembered thinking, should i backup the directory tree before this chang? nah ;-) i used sed in a directory with subdirs, and it changed all directories into normal files :( the exact command: sed -i -e s/'pm_properties\([^a-z]\)/#__properties\1/g' * after which i discovered it had name the directories -e and had turned into regular files. no warnings whatsoever. (btw, yes i know that it should have been -i.orig) weird thing is, i can't reproduce the bug, and the command history wasn't big enough to figure out what was so special about this particular situation... sed sais 'in-place editing only works for regular files' but this time it didn't.... my question though: is there _any_ way to flip the bit that marks the file being a directory? it would really be helpful to me because i've just lost a lot of work. any ideas? bye Martijn.