, @John1024, ol 'cut paste, bash :
$ cat data | echo $(( $( cut -d' ' -f2 | paste -s -d+ - ) ))
15
$
The trick here is to say pasteinsert +as a separator, and then do the bash arithmetic using $(( ))in the resulting expression.
Note. I am just catentering the input for illustrative purposes - it can be transferred from another source or data file transferred directly to cut.
source
share