diff

Performing character-level comparison of "strings" without explicitly creating temporary files for git diff

Performing character-level comparison of "strings" without explicitly creating temporary files for git diff Referring to this https://stackoverflow.com/a/31356602, I wrote this code: #!/bin/bash # Define the two strings to compare string1="First string with some random text." string2="Second string with some random text and some changes." # Create a temporary directory temp_dir=$(mktemp -d) # Create temporary files …

Total answers: 1

How to use kdiff3 to edit when comparing two files

How to use kdiff3 to edit when comparing two files I’m used to meld for editing while seeing an intra-line diff that’s updated live in response to edits. One just types in the left or right pane of the window and then save one or both files. I’m trying to use kdiff3 for the same …

Total answers: 1

Group results using comm

Group results using comm Using comm I get results that look weird from this: comm -3 <(. "$first_env_file"; env) <(. "$second_env_file"; env) I get something like: AUTH_LP_ACCOUNT_ID=xxx1 AUTH_LP_ACCOUNT_ID=xxx2 AWS_IMAGE_DOMAIN_NAME=abc AWS_IMAGE_DOMAIN_NAME=zyx NODE_ENV=local NODE_ENV=staging NODE_PORT=3000 NODE_PORT=4000 REDIS_HOST=localhost REDIS_HOST=redis (and yes the spaces in front (prepended tabs/spaces) are there) what I would rather it look like is something …

Total answers: 1

diffing two .env files

diffing two .env files I have two env files, let’s say x.env and y.env, the order of the variables is different, but the content could be the same but likely different. Is there some tool I could use to diff the variables? env -i ( # clear all envs source x.env; env | sort > …

Total answers: 1

Force Patch character differences to a file

Force Patch character differences to a file Hello, I have an englishStrings.json file and when I make new edits/ additions to it, I need to copy the new changes to all the other language string.json files. Before making any changes to englishStrings, the englishStrings and otherLanguageStrings have the same keys and same number of lines …

Total answers: 1

Return list using git diff and grep

Return list using git diff and grep I’m using git diff to return the file names of files recently changed and i’m trying to pipe the returned file names into a grep expression that searches each file and returns the files that have "*.yml" in the file name and "- name:" in the actual file. …

Total answers: 1

ansible comparing all files in 2 directories and printing the difference

ansible comparing all files in 2 directories and printing the difference I have 2 directories $ tree dir{1..2} dir1 ├── file1 └── file2 dir2 ├── file1 └── file2 I want to compare all files in dir1 with all files in dir2 using ansible and print differences like this output: ${file1} from ${dir1}: diff content ${file1} …

Total answers: 1

How to apply a patch as part of a pipe? In other words, how to patch stdin?

How to apply a patch as part of a pipe? In other words, how to patch stdin? I want to apply a unified diff from mypatch.diff to stdin and output the result to stdout. So far, I have tried: patch -i mypatch.diff -o – -u originalfile Which successfully applies mypatch.diff and prints the result to …

Total answers: 2

How to get difference of two csv files by columns and write diff into 3rd file?

How to get difference of two csv files by columns and write diff into 3rd file? I have two csv files like this; 422174,XN,20.99,2020-09-01,2022-01-20 20:20:28.613+00 421348,SB,21.99,2021-01-26,2022-01-20 20:20:28.613+00 885176,XN,41.80,2021-11-17,2022-01-20 20:20:28.613+00 881751,SB,12.81,2020-09-01,2022-01-20 20:20:28.613+00 722483,XN,67.50,2020-09-01,2022-01-20 20:20:28.613+00 Second file; 422174,XN,25.99,2020-09-01,2022-01-21 20:20:28.613+00 667843,XN,22.99,2020-09-01,2022-01-20 20:20:28.613+00 421348,SB,21.99,2021-01-26,2022-01-20 20:20:28.613+00 885176,XN,41.80,2021-11-17,2022-01-20 20:20:28.613+00 881751,SB,12.81,2020-09-01,2022-01-20 20:20:28.613+00 156734,XN,34.50,2020-09-01,2022-01-20 20:20:28.613+00 Output should be ; 667843,XN,22.99,2020-09-01,2022-01-20 20:20:28.613+00 156734,XN,34.50,2020-09-01,2022-01-20 20:20:28.613+00 …

Total answers: 3

How to get difference of two csv files and write diff into 3rd file?

How to get difference of two csv files and write diff into 3rd file? I have two csv files like this; 422174,XN,20.99,2020-09-01,2022-01-20 20:20:28.613+00 421348,SB,21.99,2021-01-26,2022-01-20 20:20:28.613+00 885176,XN,41.80,2021-11-17,2022-01-20 20:20:28.613+00 881751,SB,12.81,2020-09-01,2022-01-20 20:20:28.613+00 722483,XN,67.50,2020-09-01,2022-01-20 20:20:28.613+00 Second file; 667843,XN,22.99,2020-09-01,2022-01-20 20:20:28.613+00 421348,SB,21.99,2021-01-26,2022-01-20 20:20:28.613+00 885176,XN,41.80,2021-11-17,2022-01-20 20:20:28.613+00 881751,SB,12.81,2020-09-01,2022-01-20 20:20:28.613+00 156734,XN,34.50,2020-09-01,2022-01-20 20:20:28.613+00 Output should be ; 667843,XN,22.99,2020-09-01,2022-01-20 20:20:28.613+00 156734,XN,34.50,2020-09-01,2022-01-20 20:20:28.613+00 How can I do …

Total answers: 1

Diffing two directories well

Diffing two directories well I need to diff (and merge) two directories (practically same content, with a few extra inserted lines in one set of files). Alas, all diff programs I tried (kompare, diffmerge, kdiff3, diffuse, xxdiff, ) don’t do a good job of showing the differences (screenshot from intellij idea); or are limited to …

Total answers: 1

How I can get the missing lines from a.txt files using diff?

How I can get the missing lines from a.txt files using diff? I have the following files: a.txt 1 2 11 22 33 444 b.txt 1 2 3 11 22 33 555 I want to retrieve the lines from a.txt that do not exists on b.txt. I tried with that: diff a.txt b.txt -d 2a3 …

Total answers: 2

Have git diff color customization

Have git diff color customization How can git diff color be changed to one’s disposal, or such as for diff …? in ~/.gitconfig: [color "diff"] added = yellow changed = red bold not work. Please sincere help appreciated Asked By: cantik memekmu || Source The git-config(1) manual details the available slots; your added and changed …

Total answers: 1

Recursively list path of files only

Recursively list path of files only Why I have two folders that should contain the exact same files, however, when I look at the number of files, they are different. I would like to know which files/folders are present in one, not the other. My thinking is I will make a list of all the …

Total answers: 3

How to change diff side by side markers to other ones?

How to change diff side by side markers to other ones? I use diff -y <file1> <file2> or sdiff <file1> <file2> but I can’t find how to change markers from the defaults which are: < > | In particular, I would like to add a visible equality marker (as default one is a whitespace) replacing …

Total answers: 1