Created
March 15, 2016 13:51
-
-
Save Evgenyoliver/3b9ba51a4f34aa440ab2 to your computer and use it in GitHub Desktop.
Linux patch file example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir modules | |
cat > modules/f1 << EOM | |
String 1 | |
String for replace | |
EOM | |
cat > modules/f2 << EOM | |
String 1 | |
String replaced | |
EOM | |
# diff -Naur f1 f2 | |
# cat << EOF | patch -p0 | |
# --- f1 | |
# +++ f1 | |
# @@ -1,2 +1,2 @@ | |
# String 1 | |
# -String for replace | |
# +String replaced | |
# EOF | |
# diff -Naur modules/f1 modules/f2 | |
cat << EOF | patch -p1 | |
--- old/modules/f1 | |
+++ new/modules/f1 | |
@@ -1,2 +1,2 @@ | |
String 1 | |
-String for replace | |
+String replaced | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment