Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: diff command

by bjohn (Initiate)
on Mar 31, 2011 at 19:55 UTC ( #896722=note: print w/replies, xml ) Need Help??


in reply to Re: diff command
in thread diff command

I do not understand what this means. 0a1,4 means and how to make the output files identical

Replies are listed 'Best First'.
Re^3: diff command
by ikegami (Pope) on Mar 31, 2011 at 20:33 UTC

    I do not understand what this means. 0a1,4 means

    "a" denotes an addition. "d" denotes a deletion. The numbers on the left form a range of line numbers in file1. The numbers on the right form a range of line numbers in file2.

    and how to make the output files identical

    Some options:

    cp file1 file2
    cp file2 file1
    truncate -s 0 file1 file2

      PerlMonks really needs a rating system like /. I would sooo cast my votes to mod up that reply funny. Thanks :)

Re^3: diff command
by choroba (Archbishop) on Mar 31, 2011 at 20:19 UTC
    From man diff:
    These lines resemble ed subcommands to convert file1 into file2.
    See man ed
Re^3: diff command
by afoken (Canon) on Mar 31, 2011 at 21:04 UTC

    I prefer the unified diff format, it is usually easier to read than the traditional format. You can get that format with the -u parameter, i.e. diff -u old new (at least with GNU diff).

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://896722]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2021-04-19 06:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?