'diff 2 files and print only difference bash in Jenkins job
I try to diff to 2 file in bash in Jenkins job
If i do this in minigw (eg gitbash) all working just fine
But if run same command in Jenkins i got all from files 2
For example i try 3 different methods
comm -1 -3 --nocheck-order file1.txt file2.txt
grep -vxF -f file1.txt file2.txt
diff --changed-group-format='%>' --unchanged-group-format='' file1.txt file2.txt
File is output of sqlplus command i and output is already sorted like this:
First file: STANDARD CONSTANT PL_SQL CREATE_OUT RECALL
And second file
STANDARD CONSTANT PL_SQL CREATE_OUT RECALL CONFIRM
I'm using git bash as shell and works in Windows. In git bash if i run any above command i got only changes and if i run same command in Jenkins i got all output from file2.txt
This driving me crazy(
UPD. I also try windows command findstr /bevg:file1.txt file2.txt
Same result(
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|