Showing posts with label directories. Show all posts
Showing posts with label directories. Show all posts

Saturday, December 18, 2010

merge of directories in clearcase

It depends on the history of the two versions of a directory being merged from one branch to another:

if one version has removed files (i.e. has less files than the other version)if said version is merged onto the other,

the resulting version will have less files than initially shown in the view.

That could be because:

that view is not the one used for the mergethat view is the correct one, but with an eclipsed or hijacked content (privates files replacing versioned files)

In any case, what would help in the mentioned view is:

a 'cleartool ls' in the directory mergeda 'cleartool ls' in the parent directory of the directory merged.

The output of those two commands would help to confirm the exact status of the files merged within that directory, as well as the status of the directory itself.


View the original article here

Tuesday, November 9, 2010

recursive listing of directories

If the purpose is to get the job done, then use pre-built tools such as 'find' or 'ls -R' to do the job reliably.

Assuming that the purpose is to learn about recursion and shell scripting, rather than to get the job done, then it is not working fine for a number of reasons:

It won't handle names with spaces in them.When something isn't a directory, the cd will at best produce an error message.At worst, if CDPATH is set and the name can be found on CDPATH, then the script is going to go haywire.Because you don't check that the cd works, you're apt to see the same files listed over, and over, and over again (once per file in a given directory).

Additionally, the two semi-colons are superfluous.

If you do need to use cd in a script, it is usually a good idea to do that in sub-shell:

if [ -d $i ]then ( cd $; pwd; recur_fun )fi

When the sub-shell completes, you know the parent is still in exactly the same place it was in before - it doesn't depend on the vagaries of what the cd command does across symlinks. Modern shells (meaning bash) seem to think that you should normally want a 'logical cd' operation, which bugs the hell out of me because I almost never do want that behaviour.


View the original article here