Tag Info

New answers tagged


Using printf and process substitution diff -y <(printf '%s\n' "${arr1[@]}") <(printf '%s\n' "${arr2[@]}") 1 1 2 2 3 | A


You could use: grep -v -f <(sed -r 's/([^=]*).*$/\1/' fr.i18n.txt) en.i18n.txt Which filters all keys from fr.i18n.txt from en.i18n.txt. Example: $ cat > en.i18n.txt ui.title=Title ui.close=Close ui.edit=Edit ui.accept=Accept ^D $ cat > fr.i18n.txt ui.title=Titre ui.edit=Modifier ^D $ grep -v -f <(sed -r 's/([^=]*).*$/\1/' fr.i18n.txt) ...


The following takes two files, eng and fr, sorts them on the key, and "joins" them on the key, showing only any missing entries from file 1 (eng). join -t= -v1 <(sort -t= -k 1,1 eng) <(sort -t= -k 1,1 fr) So the sort on key you want is eg: sort -t= -k 1,1 eng


Here's a quick bash script I wrote to compare extended attributes. It prints out every file name, and then any differences in attributes: cd a export relpath=[path/to/b/from/a] for filename in $(find .); do echo $filename; diff <(xattr -l $filename) <(xattr -l $relpath/$filename); done Borrowing from another answer, we can modify this to ...


You can use grep function to see the difference (file3 is the output file): grep -Fxvf file1 file2 > file3 Where the flags are: -F : Interpret PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched. -x : Select only those matches that exactly match the whole line. -v : Invert the sense of matching, to select ...


gnu diff provided you have gnu diff (from diffutils, diff (GNU diffutils) 3.3). diff --old-line-format='old %L' --new-line-format='new %L' --unchanged-group-format='' u v old PV Name /dev/dsk/c0t4d0 new PV Name /dev/dsk/c99t4d0 (redirecting to a file is explain below). basic diff with awk with basic diff, ...


diff a b > differences should do the job. The differences between the two files will be stored in the file differences.

Top 50 recent answers are included