Jump to content











Photo
- - - - -

cmp takes skip and length

grub4dos

  • Please log in to reply
No replies to this topic

#1 deomsh

deomsh

    Frequent Member

  • Advanced user
  • 196 posts
  •  
    Netherlands

Posted 27 February 2023 - 11:11 PM

With help of the famous experimental method I found grub4dos internal function cmp can be used for more than blocklists, comparison of whole-sectors or two files with identical filesize.

 

If comparing a file and a bloklist or two blocklists, cmp seems to take skip and filesize in the same way as known for cat. As far as I know this is undocumented. Please correct me if I am wrong :ph34r:

See first print-screen for an example:

 

CMP with skip and length I.png

 

BTW as can be seen even cmp --hex FILE is willing to take skip, but the value of %@retval% seems to have the meaning that cat --hex succeeded to give output on screen - nothing more

 

As long as filesize is same, normal cmp with skip seems to give correct results. See second print-screen for comparison of a file and a blocklist:

 

CMP with skip and length II.png

 

Same for two blocklists, see last print-screen:

 

CMP with skip & length III.png

 

BTW as can bee seen even dd seems to take copy-size after the blocklist comma - bs and count does not seem necessary in this case

 

Used grub4dos version: 2022-12-22







Also tagged with one or more of these keywords: grub4dos

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users