/ Published in: Awk

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# print every line after replacing each field with its absolute value awk '{for (i=1; i<=NF; i++) if ($i < 0) $i = -$i; print }' awk '{for (i=1; i<=NF; i++) $i = ($i < 0) ? -$i : $i; print }'
Comments
