Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¡¶Linux diffÓëpatchµÄÉîÈë·ÖÎö¡·

diffµÄÊä³ö¸ñʽ·ÖΪ´«Í³¸ñʽºÍͳһ¸ñʽ
1)diffµÄ´«Í³¸ñʽÊä³ö.
############################################
cat before.txt
Êä³ö:
This is a line to be deleted
This is a line that will be changed
This is a line that will be unchanged
cat after.txt
Êä³ö:
This is a line that has been changed
This is a line that will be unchanged
This is a line that has been added
############################################
diff before.txt after.txt
Êä ³ö:
1,2c1
< This is a line to be deleted
< This is a line that will be changed
---
> This is a line that has been changed
3a3
> This is a line that has been added
############################################
×¢ÊÍ:
´«Í³¸ñʽµÄÊä³ö
1,2c1ÊÇÖ¸Ìæ»»µÚ1¸öÎļþµÄµÚ1,2Ðе½µÚ2¸öÎļþµÄµÚ2ÐÐ,ÕâÀïµÄ1,2ÊÇÖ¸µÚ1¸öÎļþµÄµÚ1,2ÐÐ,cÊÇÌæ»»µÄÒâ˼,×îºóµÄ1ÊǵÚ2¸öÎļþµÄµÚ1ÐÐ
<ºÅÊÇÖ¸µÚ1¸öÎļþ¸ü¸Ä»òɾ³ýµÄÐÐ
---ºÅÊÇ·Ö¸îÁ½¸öÎļþ
>ºÅÊǵÚ2¸öÎļþÖÐÔö¼Ó»òɾ³ýµÄÐÐ
3a3ÊÇÖ¸½«µÚ2¸öÎļþµÄµÚ3ÐвåÈëµ½µÚÒ»¸öÎļþµÄµÚ3ÐÐ
Ò²¾ÍÊÇ˵µÚ1¸öÎļþµÄ:
< This is a line to be deleted
< This is a line that will be changed
±»Ìæ»»³ÉµÚ2¸öÎļþµÄ:
> This is a line that has been changed
ÓÉÓÚµÚ1¸öÎļþµÄµÚ3Ðк͵Ú2¸öÎļþµÄµÚ2ÐÐÒ»ÖÂ,ËùÒÔ²»×öÐÞ¸Ä.
ÓÉÓÚµÚ2¸öÎļþµÄµÚ3ÐÐÊǵÚ1¸öÎļþËù²»¾ßÓеÄ,ËùÒÔÔÚµÚ1¸öÎļþµÄ×îºóÒ»ÐÐÔö¼Ó:
> This is a line that has been added
2)patchÃüÁîµÄÓ¦ÓÃ
ÓÃdiffµÄ´«Í³¸ñʽÊä³ö:
#################################
diff before.txt after.txt >mypatch.txt
#################################
ÓÃpatchÐÞ²¹before.txtÎļþ,ʹbefore.txtºÍafter.txtÒ»ÖÂ.
#################################
cat mypatch.txt |patch before.txt
Êä³ö:
patching file before.txt
#################################
±È½ÏÁ½¸öÎļþ£¬ÏÖÔÚÊÇÒ»ÖµÄÁË.
#################################
cmp before.txt after.txt
#################################
ÓÃpatchÃüÁî»Ö¸´before.txt.
#################################
patch -R before.txt <mypatch.txt
Êä³ö:
patching file before.txt
#################################
×¢:-R±ê¼Ç¸æËßpatchÔÚ·´ÏòÉÏÓ¦ÓÃÇø±ð»òÕß³·Ïúpatch.
ÔÙ


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì£¨ËÄ£© L2CAP²ã±à³Ì

£¨L2CAPЭÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPЭÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼­Á¬½Ó¿ØÖƺÍÊÊÅäЭÒé (L2CAP) ΪÉϲãЭÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àЭÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãЭÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......

ʵսLinux Bluetooth±à³Ì(Áù) L2CAP±à³ÌʵÀý

ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
 Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......

linux diff ÃüÁîÏê½â


Ê×Ò³


½²Êö£ºÎÒÓë51CTO²»µÃ²»ËµµÄ¹ÊÊÂ
    ²©¿Í»¥¶¯×¨Ìâ Ö® 2009£¬Í´²¢¿ìÀÖ×ŵÄITÈË
²©Ö÷µÄ¸ü¶àÎÄÕÂ>>

linux diff ÃüÁîÏê½â

2009-02-13 14:01:37
¡¡±êÇ©£ºlinux
diff
ÃüÁî
¡¡¡¡¡¡[ÍÆË͵½¼¼ÊõȦ
]


¹¦ÄÜ˵Ã÷£º±È½ÏÎļþµÄ²îÒì¡£
Óï
¡¡¡¡·¨£ºdi ......

LinuxÖÐALIGNºêµÄÔ­Àí

1. Òý×Ó
int a;  
int size = 8;
   
Èç¹ûÈÃaΪ(size =8)µÄÕûÊý±¶±íʾ³É¶þ½øÖÆÓ¦ÊÇʲôÑù×ÓÄØ£¿ÄǾÍÊÇÈÃÕâ¸öÊý±íʾ³É¶þ½øÖÆÊ±µÄ×îºóÈýλΪ0.
¶øÒª´ïµ½ÕâһĿ±ê£¬Ö»ÒªÏÂÃæÕâ¸öÊýÓëËü½øÐÐÓëÔËËã¾Í¿ÉÒÔÁË:
  11111111 11111111 11111111 11111000  
¶øÉÏÃæÕâ¸öÊýʵ¼ÊϾÍÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ