Re: tricky list comparison problem - Resolved

2005-09-02 Thread Jason Ross
On 9/2/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > Jason Ross wrote: > > > > I'm trying it on a second drive however, and am getting results that > > don't look right ... > > > The problem is that you are including the data from partition 2. If you > exclude it then you will get the correct

Re: tricky list comparison problem

2005-09-02 Thread John W. Krahn
Jason Ross wrote: > > I'm trying it on a second drive however, and am getting results that > don't look right ... > > That drive has the following partitions defined: > > * First Sector Last > * Partition Tag FlagsSector Count Sect

Re: tricky list comparison problem

2005-09-01 Thread Randy W. Sims
Jason Ross wrote: Anyway, the issue I have is that I need to determine where there are gaps between the first sector and last sector (on the entire disk, not on a given partition). So, for example, using the sample data below, I want to return "2097415 - 69078878" as available sectors. Hi J

Re: tricky list comparison problem

2005-09-01 Thread Jason Ross
heh. i didn't realize i sucked this bad =) On 9/1/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > > Anyway, the issue I have is that I need to determine where there are > > gaps between the first sector and last sector (on the entire disk, not > > on a given partition). > > How do you determine wh

Re: tricky list comparison problem

2005-09-01 Thread John W. Krahn
Jason Ross wrote: > Hello. Hello, > I'm having a bit of an issue with a script I'm working on. The goal is > to parse the output of the solaris `prtvtoc` command and do some things > based on it. I've got that part down, and am placing the bits I care > about into a hash which is best written (I

tricky list comparison problem

2005-08-31 Thread Jason Ross
Hello. I'm having a bit of an issue with a script I'm working on. The goal is to parse the output of the solaris `prtvtoc` command and do some things based on it. I've got that part down, and am placing the bits I care about into a hash which is best written (I think ... ) as : $partition

Re: Comparison problem

2001-11-16 Thread Etienne Marcotte
my @fileNames = (".","..",1,2,3,4,5,6,7,8,9); #assuming that's what the readdir gives. splice (@fileNames,0,2); #removes the . and .. foreach(@fileNames){ if (!-e $_){ print "Sending missing for file: $_"; sendMissing($_); pause(); } } I'm not sure we can use the !-e (-e test existe

Re: Comparison problem

2001-11-16 Thread Michael D. Risser
On Friday 16 November 2001 01:36 pm, Etienne Marcotte rambled: > > for(my $i = 2, my $j = 1; $i <= $last;$i++, $j++) { > > if ($j ne $fileNames[$i]) { > > print "Sending missing for file: $fileNames[$i]"; > > &sendMissing($j); > > &pause; > > next; > > } >

Re: Comparison problem

2001-11-16 Thread Etienne Marcotte
> for(my $i = 2, my $j = 1; $i <= $last;$i++, $j++) { > if ($j ne $fileNames[$i]) { > print "Sending missing for file: $fileNames[$i]"; > &sendMissing($j); > &pause; > next; > } You never close the opening bracket in the if statement. and your for is not

Re: Comparison problem

2001-11-16 Thread Michael D. Risser
I've rewritten the algorithm, but it still is not working correctly. Files 1, 2, 3, 4, 5 are all present, 6 and 7 are missing and 8 is present. When it gets to the first missing file (6) it skips right over 6 and 7 without running the code in the if statement, but then runs the if statement co

RE: Comparison problem

2001-11-08 Thread Bob Showalter
> -Original Message- > From: Etienne Marcotte [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 08, 2001 2:24 PM > Cc: 'Michael D. Risser'; [EMAIL PROTECTED] > Subject: Re: Comparison problem > > > In my previous post I used -f for missing file, bu

Re: Comparison problem

2001-11-08 Thread Etienne Marcotte
lto:[EMAIL PROTECTED]] > > Sent: Thursday, November 08, 2001 11:01 AM > > To: [EMAIL PROTECTED] > > Subject: Comparison problem > > > > > > I have a script which in part takes a list of files in a > > directory (the name > > of each file is a numb

Re: Comparison problem

2001-11-08 Thread Etienne Marcotte
oops it's -f and after reading Bob's reply you need to remove . and .. so: print "Number of files to process:" $#fileNames-1; # maybe with dots between the parts print "\n Press any key to continue, Ctrl-C to exit\n"; chomp(my $in=); for(0..$#fileNames-2) { if (-f) {

RE: Comparison problem

2001-11-08 Thread Bob Showalter
> -Original Message- > From: Michael D. Risser [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 08, 2001 11:01 AM > To: [EMAIL PROTECTED] > Subject: Comparison problem > > > I have a script which in part takes a list of files in a > directory (the name

Re: Comparison problem

2001-11-08 Thread Etienne Marcotte
#|--Remove Before Flight--> print "Number of files to process:" $#fileNames+1 "\n"; # maybe with dots between the parts print "Press any key to continue, Ctrl-C to exit\n"; chomp(my $in=); #<--Remove Before Flight--| # Go through each file we found for(0..$#fileNames) { if (-e $

Comparison problem

2001-11-08 Thread Michael D. Risser
I have a script which in part takes a list of files in a directory (the name of each file is a number), sorts them numerically, and then runs through each file checking to see if any are missing, and performing a set action if it is missing, or a different action if it is present. My problem i