Solved

Need a trigger to block mkelem to name elem with space

Posted on 2008-10-14
1
423 Views
Last Modified: 2012-08-13
I am attempting to stop developers from renaming elements with spaces in the filename.  I contacted IBM tech support and they recommend I create a check-in trigger that will fire a Perl script which will check the string pattern for a space (\s or \S) and will either fail and not allow the users to name the element with the space.  I am a novice with ClearCase, and any help or guidance is appreciated in advance.

Please help.
0
Comment
Question by:MADDOGIRISHMAN
1 Comment
 
LVL 39

Accepted Solution

by:
Adam314 earned 500 total points
ID: 22723337
I'm not familiar with ClearCase administration, but from looking around, this should get you close:




***** Create this perl script,
***** save it somewhere all users can access,
***** give it execute permission to all users who will run it
#!/usr/bin/perl
use strict;
 
my $FileName = $ENV{CLEARCASE_PN};
die "You can not use spaces in your file name\n" if $FileName =~ /\s/;
 
 
***** Execute this command at prompt to install the trigger
***** change the /path/to/perl/script.pl to what you saved the above
cleartool mktrtype -c "Trigger to prevent spaces in filenames" -element -all -preop checkin -exec "perl /path/to/perl/script.pl" CHECK_FILENAME_FOR_SPACES

Open in new window

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question