how can i make a string with an integer in bash?

It could be simplified just to

awk -F: '{sumA+=$1; sumB+=$2} END {printf "%s\n%s\n", sumA, sumB}' random.txt

From the manual:

$ man awk

-F fs
--field-separator fs
    Use fs for the input field separator (the value of the FS predefined variable).

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top