Questions tagged [cmp]

cmp is a command line utility for computer systems that use Unix or a Unix-like operating system.It compares two files of any type and writes the results to the standard output

By default, cmp is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported.

Return values:

0 —> files are identical
1 —> files differ
2 —> inaccessible or missing argument

Read more

150 questions
2
votes
2 answers

How to compare 2 (image) files in a (os x) bash script ignoring the last changed/modified date headers?

I would like to recursively compare screenshot files in a directory. I tried using cmp but it always returns a difference - even if the images are not visually different - I guess the difference in the file must be the last changed and last modified…
pax
  • 482
  • 8
  • 26
2
votes
1 answer

Can this cmp function be better written as a key for sorted()?

I was writing a solution to the problem of how to generate the maximum integer by rearranging then concatenating integers from a set. I was given that for the maximum integer, the arrangement of any two of its adjacent integers from the set when…
Paddy3118
  • 4,704
  • 27
  • 38
2
votes
1 answer

How to convert IA32 'cmp' instruction to Y86?

IA32 to Y86 ATT Assembly I have the following IA32 assembly code: Bubble: .LFB0: pushl %esi pushl %ebx movl 16(%esp), %esi movl 12(%esp), %edx subl $1, %esi andl %esi, %esi jle .L1 .L7: xorl %eax,…
amorimluc
  • 1,661
  • 5
  • 22
  • 32
2
votes
1 answer

No cmp keyword for max function in python

So, when sorting a list in python, the sorted function can take a cmp keyword to override the __cmp__ function of the objects we are sorting. I would expect max to have a similar keyword, but it doesn't. People know why? And in any case, anyone know…
SamBob
  • 849
  • 6
  • 17
2
votes
2 answers

Subkey comparison function for sorting

I need a Perl comparison function that can be used with sort. Each key is a text string that has an arbitrary number of subkeys, separated by delimiter characters (dot, colon, space, and slash). Some subkeys are numeric, and need to be sorted…
Jeff Learman
  • 2,914
  • 1
  • 22
  • 31
1
vote
2 answers

Android: IntentFilters for components

What is a reasonable way to filter out specific cmp Strings with an Android IntentFilters which are declared in code in broadcast Receivers (rather than in android.xml)? The case I'm searching for has: action = android.intent.action.MAIN …
Tim Capes
  • 655
  • 2
  • 7
  • 12
1
vote
2 answers

how can make a batch file that will mount a iso file?

I have a ISO game file that I have to mount with virtual clone drive every time I turn on the computer. So I want to make a simple batch file that mounts the ISO file with the VCD program automatically. With this I can click on the batch and let it…
mendez
  • 25
  • 1
  • 4
1
vote
0 answers

TFTP server written in C - Binary diff at the client end shows a difference but not always

I have written a tftp server in C . The tftp client I am using is the native linux client . The file transfer seems to happen correctly . The sent and received file sizes appear to be the same . But if I do "cmp" on both the files there is a…
Ash
  • 11
  • 1
  • 2
1
vote
1 answer

compare two files except first bytes of each lines with shell command

I have two log files with every line starting by the time. I'd like to compare the files except for this time part. for exemple : file1.og [20220201_133108] abc [20220201_133108] defg [20220201_133108] hi [20220201_133108]…
hugogogo
  • 501
  • 4
  • 24
1
vote
1 answer

Comparing directory listings using cmp command

If cmp command is used to compare two directory listings (ls dir1 and ls dir2), will it compare the contents of the files in both directories or just the file names in both directories?
haruya
  • 37
  • 8
1
vote
1 answer

Python cmp() function

Hello I was trying to compare two tuples in python using the cmp() function But there was an error wich is the following: NameError: name 'cmp' is not defined my Code: myStupidTup = ("test",10,"hmm",233,2,"am long string") mySmartTup =…
radh ouane
  • 23
  • 5
1
vote
0 answers

Invalid cmp type when trying to test tcf consents

I'm trying to implement TCF 2.0 consents on amp page. Here is a sample code which I took from https://github.com/ampproject/amphtml/blob/master/examples/amp-consent/cmp-vendors.amp.html
Andrii Sukhoi
  • 749
  • 5
  • 14
1
vote
0 answers

unable to run assemble exe file

I'm trying to print hello word with assembly on Windows 10. I successfully converted the object file to executable file with nasm -f elf64 hello.asm and ld hello.o -o hello but when I run the file nothing print on screen . My code: section .text …
karam
  • 33
  • 7
1
vote
1 answer

simple 8086 compare instruction problem

recently i have a 8086 assembly homework to finish, i try to use the CMP instruction , but can't get it right.here is the code: MOV AL, 88h CMP AL, 24h JL exit label: mov al,4h exit: RET when i debug it , after jl it jump right to…
danny
  • 1,095
  • 2
  • 12
  • 27
1
vote
2 answers

Custom sort on two columns with condition Pandas

I have a data frame as the following: df = pd.DataFrame({'id':[3333311,3455572,6464544,2323322,2222111,4333311,5454566,3321767],'A':['12 days','35 days','36 days','56 days','54 days','44 days','56 days','54 days'],'B':['6 days','31 days','33…
user9419602
  • 31
  • 1
  • 6
1 2
3
9 10