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

linux CÕýÔò±í´ïʽ

ÔÚÍøÉÏÕÒµ½µÄÒ»¸ö³ÌÐò
[c]
#include <stdio.h>
#include <sys/types.h>
#include <regex.h>
/* È¡×Ó´®µÄº¯Êý */
static char* substr(const char*str,unsigned start, unsigned end)
{
      unsigned n = end - start;
      static char stbuf[256];
      strncpy(stbuf, str + start, n);
      stbuf[n] = 0;
      return stbuf;
}
/* Ö÷³ÌÐò */
int main(int argc, char** argv)
{
      char * pattern;
      int x, z, lno = 0, cflags = 0;
      char ebuf[128], lbuf[256];
      regex_t reg;
      regmatch_t pm[10];
      const size_t nmatch = 10;
/* ±àÒëÕýÔò±í´ïʽ*/
      pattern = argv[1]; //»ñÈ¡ÕýÔò±í´ïʽ
      z = regcomp(&reg, pattern, cflags); //Èç¹û±àÒë³É¹¦·µ»Ø0,ÆäËü·µ»Ø˵Ã÷ÓдíÎó²úÉú
      if (z != 0)
      {
             regerror(z, &reg, ebuf, sizeof(ebuf));
             fprintf(stderr, "%s: pattern '%s' \n",ebuf, pattern);
             return 1;
      }
/* ÖðÐд¦ÀíÊäÈëµÄÊý¾Ý */
      while(fgets(lbuf, sizeof(lbuf), stdin))
      {
            ++lno;
//È¡µÃ¶ÁÈ¡×Ö·û´®µÄ³¤¶È£¬²¢ÅжÏ×Ö·û´®½áβ×Ö·ûÊÇ·ñΪ»Ø³µ·û'\n'¡£Èç¹ûÊÇ£¬½«½áβ×Ö·û¸ÄΪ0
            if ((z = strlen(lbuf)) > 0 && lbuf[z-1]== '\n')
                  lbuf[z - 1] = 0;
/* ¶ÔÿһÐÐÓ¦ÓÃÕýÔò±í´ïʽ½øÐÐÆ¥Åä */
           z = regexec(&reg, lbuf, nmatch, pm, 0);
           if (z == REG_NOMATCH) continue;
 &nbs


Ïà¹ØÎĵµ£º

Linux ½ø³Ì´´½¨


×÷ÕߣºÀîÖÇÃô,»ªÇåÔ¶¼ûǶÈëʽѧԺÉϺ£·ÖÖÐÐĽ²Ê¦¡£
ÔÚ Linux ÄÚºËÄÚ£¬½ø³ÌÊÇÓÉÏ൱´óµÄÒ»¸ö³ÆΪ task_struct µÄ½á¹¹±íʾµÄ¡£´Ë½á¹¹°üº¬ËùÓбíʾ´Ë½ø³ÌËù±ØÐèµÄÊý¾Ý£¬´ËÍ⣬»¹°üº¬ÁË´óÁ¿µÄÆäËûÊý¾ÝÓÃÀ´Í³¼Æ£¨accounting£©ºÍά»¤ÓëÆäËû½ø³ÌµÄ¹Øϵ£¨¸¸ºÍ×Ó£©¡£ÏÂÃæ¸ø³öÁË task_struct µÄһС²¿·Ö¡£task_struct λÓÚ ./linux ......

linuxϵÄvirtualbox¹²ÏíÎļþ¼Ð

 ¼øÓÚÖ§¸¶±¦µÈ·þÎñÎÞÊÓÎÒÃÇLinuxÓû§µÄ´æÔÚ£¬Ã»°ì·¨£¬ÄÇÖ»ºÃÔÚLinuxÉÏÓÃVirtualBoxÐéÄâÒ»¸öWindowsϵͳÁË¡£ÏµÍ³×°ºÃÁË£¬ÔÚÈÕ³£Ê¹Óùý³ÌÖУ¬ÍùÍùÒª´ÓVirtualBoxµÄ¿Í»§»ú£¨guest system£©ÖÐʹÓÃÖ÷»ú£¨host system£©ÀïÃæµÄÎļþ£¬ÄÇôͨ¹ý¹²ÏíÎļþ¼ÐµÄ·½Ê½¿ÉÒÔ´ï³É´ËÄ¿µÄ¡£
      ÎÒÔÚÕâÀï ......

linux cÓïÑÔ selectº¯ÊýÓ÷¨

  SelectÔÚSocket±à³ÌÖл¹ÊDZȽÏÖØÒªµÄ£¬¿ÉÊǶÔÓÚ³õѧSocketµÄÈËÀ´Ëµ¶¼²»Ì«°®ÓÃSelectд³ÌÐò£¬ËûÃÇÖ»ÊÇÏ°¹ßдÖîÈç connect¡¢accept¡¢recv»òrecvfromÕâÑùµÄ×èÈû³ÌÐò£¨Ëùν×èÈû·½Ê½block£¬¹ËÃû˼Ò壬¾ÍÊǽø³Ì»òÊÇÏß³ÌÖ´Ðе½ÕâЩº¯Êýʱ±ØÐëµÈ
´ýij¸öʼþµÄ·¢Éú£¬Èç¹ûʼþûÓз¢Éú£¬½ø³Ì»òÏ߳̾ͱ»×èÈû£¬º¯Êý²»ÄÜÁ¢¼´·µ» ......

¼òµ¥FTP·þÎñÆ÷µÄ´î½¨£¨linux ¡¢windows£©

linux      ÊÂÇéÒª´ÓSSH˵Æð£¬×ʼÎÒÃÇÔ¶³Ì·ÃÎÊlinux·þÎñÆ÷£¬¶¼ÊÇÓõÄSSH£¬Õâ¸ö¶«Î÷ºÜ·½±ãÁË£¬ÌṩÁËÃüÁîÐУ¬»¹Óд°¿Ú½çÃ棬ÓÃÆðÀ´·½±ã£¬ÏàÐÅÓùýµÄÈ˶¼ÓÐÌå»á£¬µ«Êǵ±ÎÒ»»³ÉflashFXPÁ¬½ÓͬÑùµÄlinux·þÎñÆ÷ʱÔõô¶¼Á¬²»ÉÏ£¬ÕâÏÂÓôÃÆ»µÁË£¬Ôõô°ìÄØ£¿     ÔÚ¾­ÀúÁËÎÞÊý´ÎµÄ³¢ÊÔÖ®ºó£ ......

LinuxÖ®VIÃüÁîÏê½â

viÊÇËùÓÐUNIXϵͳ¶¼»áÌṩµÄÆÁÄ»±à¼­Æ÷£¬ËüÌṩÁËÒ»¸öÊÓ´°É豸£¬Í¨¹ýËü¿ÉÒԱ༭Îļþ¡£µ±È»£¬¶ÔUNIXϵͳÂÔÓÐËùÖªµÄÈË£¬
»ò¶à»òÉÙ¶¼¾õµÃvi³¬¼¶ÄÑÓ㬵«viÊÇ×î»ù±¾µÄ±à¼­Æ÷£¬ËùÒÔÏ£Íû¶ÁÕßÄܺúðÑËüѧÆðÀ´£¬ÒÔºóÔÚUNIXÊÀ½çÀï±Ø½«³©ÐÐÎÞ×è¡¢
ÓÎÈÐÓÐÓ࣬ÒòΪÆäËû¼¸ÖÖÎı¾´¦ÀíÆ÷²¢·ÇUNIX±ê×¼Å䱸¡£Ëµ²»¶¨±ðÈ˵ÄLinux»úÆ÷û°²×°j ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ