A simple mathematics-based awk solution:
$ cat <<M | awk '{for(i=2;i<=NF;i+=2){printf "%4s",($(i-1)<0?-1:1)*$i}print ""}' -1 2 3 4 -5 9 2 3.2 -4 5 -6 11 M -2 4 -9 3.2 -5 -11 - Loop from the second (
i=2) to the last field (i<=NF). - Multiply the previous field (
$(i-1)) with either -1 or 1. - Format the output nicely (
printf "%4s"), and print a trailing newline (print "").
The only caveat to this is that if you have an odd number of columns, the last field will not display anything at all. I hope this is what you expect. Apparently this is what you expect. :)
(edited to work with decimal values, and to make the loop conditions more aligned with the question while saving 2 characters.)