I wanted to add 100 to the insertions, tried below, but it is adding $1 to it instead ?
#!/bin/bash
change_summary="17 files changed, 441 insertions(+), 49 deletions(-)"
lines_added="100"
echo $change_summary
echo $change_summary | awk '{ print $1 " " $2 " " $3 " " $4+$lines_added " " $5 " " $6 " " $7}'
it prints
17 files changed, 441 insertions(+), 49 deletions(-)
17 files changed, 458 insertions(+), 49 deletions(-)
I am expecting it to print 541 insertions.
is there a better way to do the same?