I have many views in my Linux home dir under different folders mentioned below.
Home
CCVIEWS
views
Development
testproject
:
:
etc.
Now i want to list all the clearcase views in my linux dir in below format to work on other script.
user_test_Work1.vws
user_test_Work2.vws
user_dev_Work1.vws
user_newproject_Work.vws
user_cqfix.vws
How to search all the views in my home directory created by me and display the list of the views in shell script?
Current at a time I can display one folder views but I need to search and display all the views in the above format.
My views are dynamic views only not snapshot . My issue was with views stored in multiple directories . Need to search all the views in my unix home dir . Now i am using commands cd ~/views ViewCount=ls ~/views to do the job . But this will list the views in one dir . In same way i need to list all the views in my home dir in all directories .Is there any way to search all views and list views
If those views aren't under
/view
, that means there are snapshot views.(Not web views, since
cleartool
is mentioned, which means no CCRC)And as mentioned in "Find local copy of files in snapshot view", you cannot find a snapshot view from its tag alone.
That means a simple
cleartool lsview -l
with somegrep
won't select only your views from your home directory.It would select your views, wherever you chose to load them.
user_cqfix.vws
is a view workspace storage.The simplest solution would be to go to each of your
HOME
immediate sub-directories, and do acleartool lsview -l -cview
command.The owner (line "
View owner
: ...") of the view and the view storage path (line "Global path
: ...") will be listed in the output of thecleartool
command.Note, that assume that your views are loaded directly under your
HOME
.If they at a greater depth than a direct sub-directory, then you need to repeat that process recursively for all directories within your
HOME
.Finally, this makes sense if you need to associate a view storage path (
*.vws
) with the path where your snapshot view is loaded (since ClearCase won't be able to tell you where the root directory of a snapshot view is).If you don't need the root directory path, then a simple cleartool lsview -l would list all views, with you able to select the ones you want.
Look also at "About snapshot view storage directories": if all your views are using the same view storage server, then you could simply infer the view storage path by knowing its common root shared path.
Note, regarding finding "snapshot view" root directories, this thread mentions:
That being said, remember you can replicate multiple times a snapshot view (simply copy the hidden file
view.dat
found at the root directory of a snapshot view in any other directory, and presto: that snapshot view now exists in two different places!