[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] finding the monotone root directory
From: |
Hugo Cornelis |
Subject: |
[Monotone-devel] finding the monotone root directory |
Date: |
Thu, 16 Apr 2009 00:24:03 -0500 |
I fairly regularly go crazy finding the monotone root directory in a
workspace with many nested directories.
Here is a perl one liner that solves my problems:
perl -e 'print map { "$_\n" } map { glob "../" x $_ . "_MT[N]" } 0..15'
The last 15 is the maximal nesting depth.
As an example, to go to the monotone inventory directory _MTN:
cd `perl -e 'print map { "$_\n" } map { glob "../" x $_ . "_MT[N]" } 0..15'`
and to go to the root directory of the monotone workspace:
cd `perl -e 'print map { "$_\n" } map { glob "../" x $_ . "_MT[N]" } 0..15'`/..
The perl statement also takes nested workspaces into account, printing
the _MTN directory for each one found.
Obviously you can install this as a shell alias.
--
Hugo
--
Hugo Cornelis Ph.D.
Neurospaces Project Architect
http://www.neurospaces.org/
Research Imaging Center
University of Texas Health Science Center at San Antonio
7703 Floyd Curl Drive
San Antonio, TX 78284-6240
Phone: 210 567 8112
Fax: 210 567 8152
- [Monotone-devel] finding the monotone root directory,
Hugo Cornelis <=