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

Linux C ²Î¿¼ÊÖ²á Ö® »·¾³±äÁ¿Æª

getenv£¨È¡µÃ»·¾³±äÁ¿ÄÚÈÝ£©
Ïà¹Øº¯Êý putenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include<stdlib.h>
¶¨Ò庯Êý char * getenv(const char *name);
º¯Êý˵Ã÷ getenv()ÓÃÀ´È¡µÃ²ÎÊýname»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýnameΪ»·¾³±äÁ¿µÄÃû³Æ£¬Èç¹û¸Ã±äÁ¿´æÔÚÔò»á·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õë¡£»·¾³±äÁ¿µÄ¸ñʽΪname£½value¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»ØÖ¸Ïò¸ÃÄÚÈݵÄÖ¸Õ룬ÕÒ²»µ½·ûºÏµÄ»·¾³±äÁ¿Ãû³ÆÔò·µ»ØNULL¡£
·¶Àý #include<stdlib.h>
mian()
{
char *p;
if((p = getenv(“USER”)))
printf(“USER=%s\n”,p);
}
Ö´ÐÐ USER = root
¡¡
putenv£¨¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿£©
Ïà¹Øº¯Êý getenv£¬setenv£¬unsetenv
±íÍ·Îļþ #include4<stdlib.h>
¶¨Ò庯Êý int putenv(const char * string);
º¯Êý˵Ã÷ putenv()ÓÃÀ´¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýstringµÄ¸ñʽΪname£½value£¬Èç¹û¸Ã»·¾³±äÁ¿Ô­ÏÈ´æÔÚ£¬Ôò±äÁ¿ÄÚÈÝ»áÒÀ²ÎÊýstring¸Ä±ä£¬·ñÔò´Ë²ÎÊýÄÚÈÝ»á³ÉΪеĻ·¾³±äÁ¿¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»Ø0£¬ÓдíÎó·¢ÉúÔò·µ»Ø-1¡£
´íÎó´úÂë ENOMEM ÄÚ´æ²»×㣬ÎÞ·¨ÅäÖÃеĻ·¾³±äÁ¿¿Õ¼ä¡£
·¶Àý #include<stdlib.h>
main()
{
char *p;
if((p = getenv(“USER”)))
printf(“USER =%s\n”,p);
putenv(“USER=test”);
printf(“USER+5s\n”,getenv(“USER”));
}
Ö´ÐÐ USER=root
USER=root
¡¡
setenv£¨¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿£©
Ïà¹Øº¯Êý getenv£¬putenv£¬unsetenv
±íÍ·Îļþ #include<stdlib.h>
¶¨Ò庯Êý int setenv(const char *name,const char * value,int overwrite);
º¯Êý˵Ã÷ setenv()ÓÃÀ´¸Ä±ä»òÔö¼Ó»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýnameΪ»·¾³±äÁ¿Ãû³Æ×Ö·û´®¡£
²ÎÊý valueÔòΪ±äÁ¿ÄÚÈÝ£¬²ÎÊýoverwriteÓÃÀ´¾ö¶¨ÊÇ·ñÒª¸Ä±äÒÑ´æÔڵĻ·¾³±äÁ¿¡£Èç¹ûoverwrite²»Îª0£¬¶ø¸Ã»·¾³±äÁ¿Ô­ÒÑÓÐÄÚÈÝ£¬ÔòÔ­ÄÚÈݻᱻ¸ÄΪ²ÎÊývalueËùÖ¸µÄ±äÁ¿ÄÚÈÝ¡£Èç¹ûoverwriteΪ0£¬ÇҸû·¾³±äÁ¿ÒÑÓÐÄÚÈÝ£¬Ôò²ÎÊývalue»á±»ºöÂÔ¡£
·µ»ØÖµ Ö´Ðгɹ¦Ôò·µ»Ø0£¬ÓдíÎó·¢Éúʱ·µ»Ø-1¡£
´íÎó´úÂë ENOMEM ÄÚ´æ²»×㣬ÎÞ·¨ÅäÖÃеĻ·¾³±äÁ¿¿Õ¼ä
·¶Àý #include<stdlib.h>
main()
{
char * p;
if((p=getenv(“USER”)))
printf(“USER =%s\n”,p);
setenv(“USER”,”test”,1);
printf(“USER=%s\n”,getenv(“USEr”));
unse


Ïà¹ØÎĵµ£º

ÈçºÎʹÓ÷ºÐÍÄ£擬virtual? (C/C++) (template)

ÍøÉÏÒ»µÀ½ðɽµÄÃæÊÔÌ⣺
http://topic.csdn.net/u/20100524/14/0eff992a-2849-4db6-bdaa-d4a200e79b7c.html
Çë·Ö±ðÓÃC++µÄÃæÏò¶ÔÏóºÍ·ºÐÍ»úÖÆ£¬±àдʵÏÖTemplate MethodģʽµÄʾÀý´úÂ룬²¢±È½ÏÁ½ÖÖ·½Ê½¸÷×ÔµÄÓÅȱµã¡£
ÓÃÐ麯ÊýʵÏÖTemplate MethodµÄ·½Ê½¾Í²»¶à˵ÁË¡£Ó÷ºÐ͵ķ½Ê½ÊµÏÖ¶à̬ÔÚATLÀïÃæÓдóÁ¿µÄÓõ½£¡
·ºÐ͵ ......

LinuxÏÂMail·þÎñÆ÷¼ÜÉè Sendmail

Ò»£® °²×°Sendmail¡£
   
ÍêÈ«°²×°Red Hat Linux
9.0ʱ£¬Sendmail¾Í»á×Ô¶¯ÄÚÖ㬰汾ºÅΪ8.12.8-4¡£Èç¹ûÄ㲻ȷ¶¨LinuxÊÇ·ñÒѾ­°²×°ÓÐsendmail£¬¿ÉÒÔÊäÈëÒÔÏÂÃüÁî²é¿´£º
    [root@ahpeng root] rpm –qa  grep sendmail
   
Èç¹ûÈ·¶¨Ã»Óа²×°£¬ÇëÔÚÍ ......

Ó²ÅÌ°²×°linux rhel 5 ³¬¼¶¼òµ¥

Ê×ÏÈÏÂÔØÒ»¸ögrubfordos£¬´ÓÕâÀïϾÍÊÇÁË£¬http://download.csdn.net/source/1326121
ºÜСµÄ£¬²Å190k×óÓÒ£¬Ö±½Ó·ÅÖÃÔÚcÅÌ£¬È»ºó£¬´ò¿ªcÅÌ£¬ÔÚÎļþ¼ÐÑ¡ÏîÀïÃ棬°ÑϵͳÒþ²ØÑ¡Ïî´ò¿ª£¬ÏµÍ³±£»¤ÎļþÒ²´ò¿ª£¬¾Í¿ÉÒÔ¿´µ½Ò»¸öboot.iniÎļþ£¬ÔÚboot.iniÀïÃæÌí¼ÓÒ»C£º\grldr="grub for dos"
OK ¡£
Æô¶¯Ã»ÓÐÎÊÌâÁË¡£
°ÑlinuxµÄ°²× ......

LinuxÖÐerrnoʹÓÃ

µ±linuxÖеÄC apiº¯Êý·¢ÉúÒ쳣ʱ,Ò»°ã»á½«errno±äÁ¿(Ðèinclude
errno.h)¸³Ò»¸öÕûÊýÖµ,²»Í¬µÄÖµ±íʾ²»Í¬µÄº¬Òå,¿ÉÒÔͨ¹ý²é¿´¸ÃÖµÍƲâ³ö´íµÄÔ­Òò£¬ÔÚʵ¼Ê±à³ÌÖÐÓÃÕâÒ»Õнâ¾öÁ˲»ÉÙÔ­±¾¿´À´ÄªÃûÆäÃîµÄÎÊÌâ¡£µ«ÊÇ
errnoÊÇÒ»¸öÊý×Ö£¬´ú±íµÄ¾ßÌ庬Ò廹Ҫµ½errno.hÖÐÈ¥ÔĶÁºê¶¨Ò壬¶øÿ´Î²éÔÄÊÇÒ»¼þºÜ·±ËöµÄÊÂÇé¡£ÓÐÏÂÃ漸ÖÖ·½·¨ ......

Linux JDK and ANT install

Linux JDK and ANT install
linux JDKµÄ°²×°

°²×°JDK
´ÓsunÍøÕ¾ÉÏÖ±½ÓÏÂÔØJDK£ºhttp:
//java.sun.com/j2se/1.4.2
/download.htmlÌṩÁËÁ½¸öÏÂÔØ£º
1¡¢RPM in self-extracting file
(j2sdk-1_4_2_04-linux-i586.bin,
32.77 MB) Õâ¸öÊÇ×Ô½âѹµÄÎļþ£¬ÔÚlinuxÉÏ°²×°ÈçÏ£º

chmod u+x
./j2sdk-1_4_2_04-l ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ