date -d is GNU specific. Here, you're running one shell and one datadate command per line, that's terribly inefficient. Do the whole thing in perlperl:
perl -MPOSIX -pe 's{^(\d\d)/(\d\d)/(\d{4})}{ $t = mktime(0, 12, 0, $2, $1 - 1, $3 - 1900); @t = localtime $t; $t -= 86400 * ($t[6] <= 1 ? $t[6] + 2 : 1); strftime("%m/%d/%Y", localtime $t)}e' Or with Time::Piece if available:
perl -MTime::Piece -pe 's{^\d\d/\d\d/\d{4}}{ $t = Time::Piece->strptime("$& 12", "%m/%d/%Y %H"); $d = $t->day_of_week; $t -= 86400 * ($d <= 1 ? $d + 2 : 1); $t->strftime("%m/%d/%Y")}e'