I compare 2 files using Cygwin (MobaXterm) diff. Output files have -- a and ++ b lines at the first line. I want to delete only these lines. How could I do it? Here's my script:
#! /bin/bash
sort -bf $1 | uniq > a
sort -bf $2 | uniq > b
/drives/c/Software/MobaXterm_Portable_v22.0/slash/bin/diff -iw a b > c
rm a b
grep ^'+' c | awk '{sub("+","");{print}}' | sed -e 's/^[[:space:]]*//' > $1_only.txt
grep ^'-' c | awk '{sub("-","");{print}}' | sed -e 's/^[[:space:]]*//' > $2_only.txt
rm c
-- Here's the output from one file:
++ b
2
4
6
Here's the output from another file:
-- a
3
5
Thanks