Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Script to generate changelists

Script to generate changelists
Thread Tools
absmiths
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Jul 22, 2004, 04:26 PM
 
I have a command I can run 'p4 describe @#' which will give me a dump like this:

Code:
Changelist # by brad Affected Files: //whatever.java ...
And I need to create it for a whole range of numbers from say 100 - 200, each going into a separate file. Is there an easy way to do this? I am comfortable with the shell, but not good at loops or perl.
     
absmiths  (op)
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Jul 23, 2004, 12:45 PM
 
I just reread this and it's funny how much it sounds like homework!

Anyway, my problem was that I didn't know how to make a loop run along a sequence of numbers, rather than iterating over files in a directory. I did this and it worked:

Code:
#!/usr/bin/perl # BUILD THE CLASSPATH WITH A REFERENCE TO EVERY JAR IN THE LIB DIR for ($x = 1759; $x < 1872; $x++) { print "p4 describe -s $x > p4_desribe_$x\n"; `p4 describe -s $x > p4_desribe_$x\n`; }
Obviously I changed my numeric range from 100-200 to 1759-1871, and I redirected all output to files with the change number in the name. That allowed my to grep through all the files and look for entries I was interested in.

In case anyone wants to know, my original problem was to identify files in a version control system (perforce) which had changed after a certain date - but only the ones in a particular project.

I had to do this because I forgot to label the release and was trying to separate two projects.

Adios.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:17 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,