Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Dec 2006 20:12:31 +0100
From:      martijn <martijn@pacno.net>
To:        freebsd-questions@freebsd.org
Subject:   KINDA SOLVED: Re: help! directories changed into regular files! :(
Message-ID:  <20061205191228.GE21455@scratch.home.pacno.net>
In-Reply-To: <20061205155701.GA20751@scratch.home.pacno.net>
References:  <20061205155701.GA20751@scratch.home.pacno.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Heheh, now i can reproduce it ;-)

I did an in-place search&replace with sed on a bunch of symlinks to
directories, but i didn't remember they were symlinks. When you do that,
the symlink gets backed up as a normal file.

probably not the behauviour we want, but hey, thats live when you give
stupid commands ;-)

martijn.

Once upon a Tue, Dec 05 2006, martijn hit keys in the following order:
> 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 <name>-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.
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061205191228.GE21455>