Skip to main content
deleted 415 characters in body
Source Link
Elliptical view
  • 4.4k
  • 4
  • 31
  • 49

Rename parameters to help you remember what's going on:

diff <file-to-edit> <file-with-updates1) Rename the file parameters to help you remember what's going on like this:> # Rather than: diff

Rather than:

diff f1 f2    # f1=file 1, and f2=file2

think

diff file-to-edit file-with-updates

The results by default come from f1file-to-edit , with updates from f2file-with-updates

i.e. the results operate on the file-to-edit (file1), applying various updates to it..


Similarity, I find these additional renames helpful to conceptualize the results:

2) Also these command renames might help you think about what is happening:

d stands for delete, but 'remove' is more clearly what happens
a stands for add, ...... but 'insert' is more clearly what happens

Used like this:c stands for change = d + a or 'remove + insert'.

 

Used like this:

2,4d1 ---4d1 or in general D(s)-d-N ---= delete ('remove') D line(s). Then sync at line N in both.

4a24a2,4 ---or in general N-a-U(s) ---= At line N, add ('insert') update's lineupdate-line(s) U.

Note: Parameters for these two are nearly symmetric; just reversed left to right.


Change= 'remove & insert'.

2,4c54c5,6 ---or in general R(s)-c-U(s) ---= Remove R(s) lines, then insert updated lines U(s) in their place.



For example:

For example:

4a24a2,4 ---means starting at 4, add (insert) updated lines 2-4 (i.e. "2,4" means lines 2, 3 and 4)

2,4d1 ---4d1 means remove lines 2-4 (2, 3 and 4).

2,4c54c5,6 ---means remove lines 2-4 (2, 3 and 4), and insert updated lines 5-6 (5 and 6).


*I know that these are stream editor commands, and designed to be processed by a machine. For example, it really is the ed command add, not insert, but it's more helpful for me to think of insert which is what in the end is being done to the file.

They use stream operations, but I prefer to think in terms of results.*

Rename parameters to help you remember what's going on:

diff <file-to-edit> <file-with-updates> # Rather than: diff f1 f2

i.e. the results operate on the file-to-edit (file1), applying various updates to it.


Similarity, I find these additional renames helpful to conceptualize the results:

d stands for delete, but 'remove' is more clearly what happens
a stands for add, ...... but 'insert' is more clearly what happens

Used like this:

2,4d1 --- D(s)-d-N --- delete ('remove') D line(s). Then sync at line N in both.

4a2,4 --- N-a-U(s) --- At line N, add ('insert') update's line(s) U

Note: Parameters for these two are nearly symmetric; just reversed left to right.


Change= 'remove & insert'.

2,4c5,6 --- R(s)-c-U(s) --- Remove R(s) lines, then insert updated lines U(s) in their place.



For example:

4a2,4 --- starting at 4, add (insert) updated lines 2-4 (i.e. "2,4" means lines 2, 3 and 4)

2,4d1 --- remove lines 2-4 (2, 3 and 4).

2,4c5,6 --- remove lines 2-4 (2, 3 and 4), and insert updated lines 5-6 (5 and 6).


*I know that these are stream editor commands, and designed to be processed by a machine. For example, it really is the ed command add, not insert, but it's more helpful for me to think of insert which is what in the end is being done to the file.

They use stream operations, but I prefer to think in terms of results.*

1) Rename the file parameters to help you remember what's going on like this:

Rather than:

diff f1 f2    # f1=file 1, and f2=file2

think

diff file-to-edit file-with-updates

The results by default come from file-to-edit, with updates from file-with-updates.


2) Also these command renames might help you think about what is happening:

d stands for delete, but 'remove' is more clearly what happens
a stands for add, ...... but 'insert' is more clearly what happens

c stands for change = d + a or 'remove + insert'.

 

Used like this:

2,4d1 or in general D(s)-d-N = delete ('remove') D line(s). Then sync at line N in both.

4a2,4 or in general N-a-U(s) = At line N, add ('insert') update-line(s) U.

Note: Parameters for these two are nearly symmetric; just reversed left to right.


2,4c5,6 or in general R(s)-c-U(s) = Remove R(s) lines, then insert updated lines U(s) in their place.


For example:

4a2,4 means starting at 4, add (insert) updated lines 2-4 (i.e. "2,4" means lines 2, 3 and 4)

2,4d1 means remove lines 2-4 (2, 3 and 4).

2,4c5,6 means remove lines 2-4 (2, 3 and 4), and insert updated lines 5-6 (5 and 6).

added 336 characters in body
Source Link
Elliptical view
  • 4.4k
  • 4
  • 31
  • 49

Rename things toparameters to help you remember! what's going on:

diff  <file-to-edit>  <file-with-updates>   #Rather than diff f1 f2

diff <file-to-edit> <file-with-updates> # Rather than: diff f1 f2

Thei.e. the results operate on the file-to-edit (file1), applying various updates to it.


Similarity, I find these additional renames helpful to conceptualize the results:

Similarity, I find these renames helpful to conceptualize the results:d stands for delete, but 'remove' is more clearly what happens
a stands for add, ...... but 'insert' is more clearly what happens

Delete='remove' & Add='insert'.

Used like this:

2,4d1 --- D(s)-d-N --- delete ('remove') D line(s). Then sync at line N in both.

4a2,4 --- N-a-U(s) --- At line N, add ('insert') update's line(s) U

Note: They're Parameters for these two are nearly symmetricsymmetric; just reversed left to right.


Change= 'remove & insert'.

2,4c5,6 --- R(s)-c-U(s) --- Remove R(s) lines, then insert updated lines U(s) in their place.



For example:

4a2,4 --- starting at 4, add (insert) updated lines 2-4 (i.e. 2"2,44" means lines 2, 3 and 4)

2,4d1 --- remove lines 2-4 (2, 3 and 4).

2,4c5,6 --- remove lines 2-4 (2, 3 and 4), and insert updated lines 5-6 (5 and 6).


I know that these are stream editor commands, and designed to be processed by a machine. For example, it really is the ed command add, not insert, but it's more helpful for me to think of insert which is what in the end is being done to the file. They use stream operations, but I like to think in terms of results. *I know that these are stream editor commands, and designed to be processed by a machine. For example, it really is the ed command add, not insert, but it's more helpful for me to think of insert which is what in the end is being done to the file.

They use stream operations, but I prefer to think in terms of results.*

Rename things to help you remember!

diff  <file-to-edit>  <file-with-updates>   #Rather than diff f1 f2

The results operate on the file-to-edit (file1), applying various updates to it.


Similarity, I find these renames helpful to conceptualize the results:

Delete='remove' & Add='insert'.

2,4d1 --- D(s)-d-N --- delete ('remove') D line(s). Then sync at line N in both.

4a2,4 --- N-a-U(s) --- At line N, add ('insert') update's line(s) U

Note: They're nearly symmetric.


Change= 'remove & insert'.

2,4c5,6 --- R(s)-c-U(s) --- Remove R(s) lines, then insert updated lines U(s) in their place.



For example:

4a2,4 --- starting at 4, add (insert) updated lines 2-4 (i.e. 2,4 means 2, 3 and 4)

2,4d1 --- remove lines 2-4.

2,4c5,6 --- remove lines 2-4, and insert updated lines 5-6


I know that these are stream editor commands, and designed to be processed by a machine. For example, it really is the ed command add, not insert, but it's more helpful for me to think of insert which is what in the end is being done to the file. They use stream operations, but I like to think in terms of results.

Rename parameters to help you remember what's going on:

diff <file-to-edit> <file-with-updates> # Rather than: diff f1 f2

i.e. the results operate on the file-to-edit (file1), applying various updates to it.


Similarity, I find these additional renames helpful to conceptualize the results:

d stands for delete, but 'remove' is more clearly what happens
a stands for add, ...... but 'insert' is more clearly what happens

Used like this:

2,4d1 --- D(s)-d-N --- delete ('remove') D line(s). Then sync at line N in both.

4a2,4 --- N-a-U(s) --- At line N, add ('insert') update's line(s) U

Note: Parameters for these two are nearly symmetric; just reversed left to right.


Change= 'remove & insert'.

2,4c5,6 --- R(s)-c-U(s) --- Remove R(s) lines, then insert updated lines U(s) in their place.



For example:

4a2,4 --- starting at 4, add (insert) updated lines 2-4 (i.e. "2,4" means lines 2, 3 and 4)

2,4d1 --- remove lines 2-4 (2, 3 and 4).

2,4c5,6 --- remove lines 2-4 (2, 3 and 4), and insert updated lines 5-6 (5 and 6).


*I know that these are stream editor commands, and designed to be processed by a machine. For example, it really is the ed command add, not insert, but it's more helpful for me to think of insert which is what in the end is being done to the file.

They use stream operations, but I prefer to think in terms of results.*

added 9 characters in body
Source Link
Elliptical view
  • 4.4k
  • 4
  • 31
  • 49

Rename things to help you remember!

diff  <file-to-edit>  <file-with-updates>   #Rather than diff f1 f2

The results operate on the file-to-edit (file1), applying various updates to it.


Similarity, I find these renames helpful to conceptualize the results:

Delete='remove' & Add='insert'.

2,4d1 --- D(s)-d-N --- delete ('remove') D line(s). Then sync at line N in both.

4a2,4 --- N-a-U(s) --- At line N, add ('insert') update's line(s) U

Note: They're nearly symmetric.


Change= 'remove & insert'.

2,4c5,6 --- R(s)-c-U(s) --- Remove R(s) lines, then insert updated lines U(s) in their place.



For example:

4a2,4 --- starting at 4, add (insert) updated lines 2-4 (i.e. 2,4 means 2, 3 and 4)

2,4d1 --- remove lines 2-4.

2,4c5,6 --- remove lines 2-4, and insert updated lines 5-6


I know that these are stream editor commands, and designed to be processed by a machine. For example, it really is the ed command add, not insert, but it's more helpful for me to think of insert which is what in the end is being done to the file. They use stream operations, but I like to think in terms of results.

Rename things to help you remember!

diff  <file-to-edit>  <file-with-updates>   #Rather than diff f1 f2

The results operate on the file-to-edit (file1), applying various updates to it.


Similarity, I find these renames helpful to conceptualize the results:

Delete='remove' & Add='insert'.

2,4d1 --- D(s)-d-N --- delete ('remove') D line(s). Then sync at line N in both.

4a2,4 --- N-a-U(s) --- At line N, add ('insert') update's line(s) U

Note: They're nearly symmetric.


Change= 'remove & insert'.

2,4c5,6 --- R(s)-c-U(s) --- Remove R(s) lines, then insert updated lines U(s) in their place.



For example:

4a2,4 --- starting at 4, add updated lines 2-4 (i.e. 2,4 means 2, 3 and 4)

2,4d1 --- remove lines 2-4.

2,4c5,6 --- remove lines 2-4, and insert updated lines 5-6


I know that these are stream editor commands, and designed to be processed by a machine. For example, it really is the ed command add, not insert, but it's more helpful for me to think of insert which is what in the end is being done to the file. They use stream operations, but I like to think in terms of results.

Rename things to help you remember!

diff  <file-to-edit>  <file-with-updates>   #Rather than diff f1 f2

The results operate on the file-to-edit (file1), applying various updates to it.


Similarity, I find these renames helpful to conceptualize the results:

Delete='remove' & Add='insert'.

2,4d1 --- D(s)-d-N --- delete ('remove') D line(s). Then sync at line N in both.

4a2,4 --- N-a-U(s) --- At line N, add ('insert') update's line(s) U

Note: They're nearly symmetric.


Change= 'remove & insert'.

2,4c5,6 --- R(s)-c-U(s) --- Remove R(s) lines, then insert updated lines U(s) in their place.



For example:

4a2,4 --- starting at 4, add (insert) updated lines 2-4 (i.e. 2,4 means 2, 3 and 4)

2,4d1 --- remove lines 2-4.

2,4c5,6 --- remove lines 2-4, and insert updated lines 5-6


I know that these are stream editor commands, and designed to be processed by a machine. For example, it really is the ed command add, not insert, but it's more helpful for me to think of insert which is what in the end is being done to the file. They use stream operations, but I like to think in terms of results.

added 480 characters in body
Source Link
Elliptical view
  • 4.4k
  • 4
  • 31
  • 49
Loading
Source Link
Elliptical view
  • 4.4k
  • 4
  • 31
  • 49
Loading