relevant code
my $outfile = "> /home/vobadmin/scripts/CC_mass_protect_element_log.tx +t"; open (OUTFILE,$outfile); timestamp(); # #### Get list of components from specific vob # my @voblist = `cat /home/vobadmin/scripts/voblist.txt`; foreach my $i (@voblist) { chomp($i); my $vob = "\/vobs\/$i"; chomp($vob); print '[' . timestamp() . '] Start Time'. "\n"; print OUTFILE '[' . timestamp() . '] Start Time'. "\n"; print "VOB is: $vob\n"; chdir $vob; print "Loading Array with all elements from vob: $vob\n"; my @element = `cleartool find \. \-all \-print`; my @complist = `ls $vob`; foreach my $comp (@complist) { chomp ($comp); if ($comp ne "lost\+found") { my $comppath = "$vob\/$comp"; chomp($comppath); print OUTFILE "COMPONENT IS: $comppath\n"; my $group = `cleartool desc -fmt \"%[group]p\" $comppath`; print "Getting Group for Comp: $group\n"; #print "Change Directory to Comp: $comppath\n"; #chdir $comppath; my @matches = grep {/$comppath/} @element; $comp_counter = 0; foreach my $elem (@matches) { chomp($elem); #print " Execute: $elem\n"; print "Running Command \`cleartool protect -chown vobad +min -chgrp $group -chmod 775 $elem\`\n"; my $result = `cleartool protect \-chown vobadmin \-chgr +p $group \-chmod 775 \"$elem\"`; print "\|\-\-\-\-\> $result\n"; $comp_counter++; } print OUTFILE "-----Total Elements for $comppath is: $comp +_counter\n"; } else { print "$comp is not component skipping\n"; next; } print '[' . timestamp() . ']: End Time'. "\n"; print OUTFILE '[' . timestamp() . '] End Time'. "\n"; } } sub timestamp { return localtime (time); } close OUTFILE;

During this moment my @element = `cleartool find \. \-all \-print`; which takes up to 25 minutes to gather all the elements I want to be able to show a progress or alive status on screen (dots, spinning pipe, etc..) to let user know the script is actually running.


In reply to marking time during function call by lycanhunter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.