Solved

Need a trigger to block mkelem to name elem with space

Posted on 2008-10-14
1
439 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…

751 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