in reply to RE: RE: Increment
in thread Increment
Without having anything named 'tpconfig' on my system, I can't check the man page for error messages, but I would be surprised if it allowed you to delete a drive you'd just deleted. The numbers seem to be fairly close.next if /^robot/; $count++; system( ... );
Update: Here's a more complete code segment that really ought to do it for you:
Starts at 0, doesn't execute the command unless it's found a drive. Increments the number after it executes the command, checks $? for errors. (I'm not 100% certain about the syntax of that system checking, but it was in perlfunc that way.)my $drive; my $count = 0; open( LIST, "tpconfig -l|" ) or die $!; while(<LIST>) { ($drive) = unpack '@0 A8',$_; next unless /^drive/; (system("tpconfig -delete -drive -index ${count}") == 0) or print +"Error deleting: $?"; $count++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: RE: Increment
by raj8 (Sexton) on Sep 06, 2000 at 06:46 UTC | |
|
RE: RE: RE: RE: Increment
by raj8 (Sexton) on Sep 06, 2000 at 18:37 UTC |