[svlug] Rescuing from test/test/test/test/...

J C Lawrence claw at cp.net
Wed Nov 10 14:03:14 PST 1999


On Wed, 10 Nov 1999 12:54:41 -0800 (PST) 
David Ljung <dave at sandcraft.com> wrote:

>> >> $ while [ 1 ]; do mkdir test; cd test ; done
>> 
>> > Ouch. But doesn't that just lead to (a really) long pathname,
>> like > /test/test/test/test/test/test/test/test/test/test etc.?
>> 
>> Yup, that's what it will do.  The question is how do you rescue
>> from that?  How do you remove taht tree?

> Many ways.  A simple, slow version is:

> $ while [ 1 ]; do mv test test2 ; mv test2/test . ; rmdir test2 ;
> done

Another approach is the walk to the bottom of the tree as far as you
can go, symlink the next branh back up to root, walk down that,
repeating the whole thing as necessary, and then rm -rf the symlink
in reverse order.

-- 
J C Lawrence                              Internet: claw at kanga.nu
----------(*)                            Internet: coder at kanga.nu
...Honorary Member of Clan McFud -- Teamer's Avenging Monolith...

--
echo "unsubscribe svlug" | mail majordomo at svlug.org
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ to unsubscribe
see http://www.svlug.org/mdstuff/lists.shtml for posting guidelines.



More information about the svlug mailing list