ivaneeo's blog

          自由的力量,自由的生活。

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks
          hello.c
          #include <stdio.h>
          int main(void)
          {
            char msg[ ] = "Hello Linux programmer!";
            puts(msg);
            printf("Here you are, using diff.\n");

            return 0;
          }

          howdy.c
          #include <stdio.h>
          #include <stdlib.h>
          int main(void)
          {
            char msg[ ] = "Hello, linux programmer, from howdy.c";
            puts(msg);
            printf("howdy.c says, 'Here you are using diff.'\n");
            exit(EXIT_SUCCESS);
          }
          使用diff的基本語法產生的輸出(在下面"理解正規輸出格式"部分所介紹的為正規格式)是:
          $diff hello.c howdy.c
          la2
          > #include <stdlib.h>
          5c6
          <   char msg[ ] = "Hello, Linux programmer!";
          ---
          >   char msg[ ] = "Hello, Linux programmer, from howdy.c!";
          8c9
          <   printf("Here you are, using diff.\n");
          ---
          >   printf("howdy.c says, 'Here you are, using diff.'\n");
          10c11
          <   return 0;
          ---
          >   exit(EXIT_SUCCESS);
          diff能夠產生幾種輸出格式,包括正規(normal,也是diff默認的市場格式),上下文(context),統一(unified)以及并排(side-by-side)4種.
          posted on 2005-08-04 17:23 ivaneeo 閱讀(145) 評論(0)  編輯  收藏 所屬分類: GNU牛力
          主站蜘蛛池模板: 巴彦淖尔市| 巫溪县| 河源市| 延寿县| 阜平县| 依兰县| 潢川县| 英山县| 北京市| 漳平市| 齐河县| 富顺县| 凭祥市| 云梦县| 旌德县| 东平县| 沂南县| 二连浩特市| 光泽县| 怀安县| 静海县| 乌苏市| 新乡市| 丹巴县| 石狮市| 民丰县| 贵定县| 兰考县| 阜康市| 来凤县| 麦盖提县| 灵台县| 淮阳县| 高碑店市| 靖西县| 石河子市| 固安县| 东丰县| 桐梓县| 普洱| 塔河县|