I need to get swap memory size in bytes from linux so i im executing this command:
{ read firstLine; while read f t s u p; do echo $s; done;} < /proc/swaps
It returns:
523260
523260
And i need to return:
1046520
i try using:
{ read firstLine; while read f t s u p; do echo $s++; done;} < /proc/swaps
but i know that is incorrect of using $s++, i im new to bash so if someone have clue or idea how do i need to increment $s variable with value that is read?
If i have for example:
523260 256523
I need to get output:
779783