I am trying to use sed to get the number of insertions/deletions from diff stat. For example, diffstat gives something like "1 file changed, 2 insertions(+), 1 deletion(-)". How can I retrieve "2" from diffstat using sed? I can't seem to figure it out.
Thanks for your time.
Figured out very simple solution-
sed 's|.*\s\(.*\)\sinsertion.*|\1|'