html tool

显示标签为“diff”的博文。显示所有博文
显示标签为“diff”的博文。显示所有博文

2024年2月19日星期一

diff比较str

 参考:https://cloud.tencent.com/developer/ask/sof/116324565


diff <( printf '%s\n' "$str1" ) <( printf '%s\n' '$str2' )

2021年4月21日星期三

转:diff 设置忽略内容 --ignore-matching-lines=RE

 https://blog.csdn.net/zhangzker/article/details/86748266

-I RE,--ignore-matching-lines=RE 忽略所有匹配RE(regexp正则表达式)的行的更改

2017年2月26日星期日

mysql db diff


add: https://dev.mysql.com/doc/mysql-utilities/1.5/en/mysqldbcompare.html

测试 shell> mysqldbcompare --server1=root@localhost emp1:emp2 --run-all-tests
--------------------------------------------------
mysqldbcompare --server1=root:password@127.0.0.1 --server2=root:password@127.0.0.1 --difftype=sql npl2:Server50505 --run-all-tests
# server1 on 127.0.0.1: ... connected.
# server2 on 127.0.0.1: ... connected.
# Checking databases npl2 on server1 and Server50505 on server2
#

# WARNING: Cannot generate SQL statements for these objects.
# Check the difference output for other discrepencies.
--- `npl2`
+++ `Server50505`
@@ -1 +1 @@
-CREATE DATABASE `npl2` /*!40100 DEFAULT CHARACTER SET latin1 */
+CREATE DATABASE `nplServer50505` /*!40100 DEFAULT CHARACTER SET latin1 */
# WARNING: Could not generate changes for {0}. No changes required or not supported difference.

# WARNING: Cannot generate SQL statements for these objects.
# Check the difference output for other discrepencies.
--- `npl2`
+++ `nplServer50505`
@@ -1 +1 @@
-CREATE DATABASE `npl2` /*!40100 DEFAULT CHARACTER SET latin1 */
+CREATE DATABASE `nplServer50505` /*!40100 DEFAULT CHARACTER SET latin1 */

#                                                   Defn    Row     Data  
# Type      Object Name                             Diff    Count   Check
# -------------------------------------------------------------------------
# TABLE     host_config                             pass    pass    pass  
# TABLE     host_conn                               pass    pass    pass  
# TABLE     host_conn_key                           pass    pass    pass  
# TABLE     host_vid                                pass    pass    pass  
# TABLE     next_hop                                pass    pass    pass  
# TABLE     property                                pass    pass    pass  

# Databases are consistent.
#
# ...done