Pipeline invokes sub-shell and all changes won't be recorded, a famous bash example:
cat file | while read line; do var_in_pipe="$line"; done
And var_in_pipe never given values, so use redirect instead.
while read line; do var_no_pipe="$line"; done < file
2019年10月29日 星期二
2019年10月26日 星期六
2019年10月21日 星期一
[ Patch ] diff and patch
diff -u original modded > mod.patch
-N : absent files as empty.
-a : text mode
-r : directory recursively
patch -p N < mod.patch
-p N : strip N leading components from file names
N=0 if diff and patch were performed under the same directory
-N : absent files as empty.
-a : text mode
-r : directory recursively
patch -p N < mod.patch
-p N : strip N leading components from file names
N=0 if diff and patch were performed under the same directory
訂閱:
文章 (Atom)
[SSH & SCP] ignore known hosts
Host's key could be changed in many cases. It's a good idea to ignore host's key if no security issues. Add following options ...
-
ps p $$ o comm=
-
As long as NIC driver supports the EEPROM can be updated via ethtool. It's convenient on production line if the EEPROM is not well pre-...