I have an array file and I need to do a math operation with the elements. The operation that I need to do is to multiply the element by itself, the to print it.The input looks like this:1: 6.170344 -0.2713546 0.3027044 0.526482: 6.193244 0.5144846 0.1467444 0.2795746 -0.318343: 6.566445 -0.1189245 0.6648346 0.12505the first row of each array is the header. The math operation need to be done with the elements of the second column.  The output need to be: 1: 6.170344 0.0736346 0.0916244 0.277182: 6.193244 0.2646846 0.0215344 0.0781546 0.101343: 6.566445 0.014145 0.4419946 0.01563Any ideas or suggestion?
How to multiply the array elements by itself
text processing
I would use awk to do this:awk '$1 ~ /^[0-9]+$/ {$2*=$2}; 1'If first column is a number, multiply the second by itself. Then print entire line.