Simple Sand Samples |
説明のないとってもシンプルなサンプルプログラム集
COBOL | awk | C言語 | D言語 | GO言語 | Lua | Vim |
bash | Perl | Gauche | Clojure | CLISP | EmacsLisp | VimScript |
tcsh | Ruby | Groovy | Java | C# | VBScript | JavaScript |
Io言語 | Python | Erlang | Scala | VB.NET | Excel/VBA | PHP |
Tcl | Haskell | OCaml | PowerShell | Windows | Unix/Linux |
Linuxコマンド > patch パッチを当てる
|
|
~$ paste before after
apple apple
banana BANANA
candy candy
dog dog
egg egg
fox fox
gate gate
hat
~$
~$
~$ cp before test.txt
~$ cat test.txt
apple
banana
candy
dog
egg
fox
gate
hat
patching file test.txt
~$ cat test.txt
apple
BANANA
candy
dog
egg
fox
gate
~$
apple apple
banana BANANA
candy candy
dog dog
egg egg
fox fox
gate gate
hat
~$
パッチを作成する
~$ diff -u before after > tmp.patch~$
~$ cp before test.txt
~$ cat test.txt
apple
banana
candy
dog
egg
fox
gate
hat
パッチを当てる
~$ patch test.txt < tmp.patchpatching file test.txt
~$ cat test.txt
apple
BANANA
candy
dog
egg
fox
gate
~$