I've been tasked with re-writing this in bash. But whilst most powershell is easy to read, i just dont get what this block is actually doing!!? Any ideas?
It takes a file which is sorted on a key first, maybe thats relevant!
Thanks for any insights!
foreach ($line in $sfile)
{
$row = $line.split('|');
if (-not $ops[$row[1]]) {
$ops[$row[1]] = 0;
}
if ($row[4] -eq '0') {
$ops[$row[1]]++;
}
if ($row[4] -eq '1') {
$ops[$row[1]]--;
}
#write-host $line $ops[$row[1]];
$prevrow = $row;
}