Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎĵµ£º

Linux iptableÎĵµ

×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......

linuxÏÂBRITEµÄ°²×°

ÎÒÓõÄJava°æ±¾Îª1.4£¬ÓÃ1.5µÄʱºò˵ÊÇÓв»°²È«µÄ²Ù×÷£¬ÎÞ·¨±àÒë¡¢ÔËÐС£
ÏÂÔØ×îа汾£¬BRITE.tar.gz
  $ gunzip BRITE.tar.gz
  $ tar xvf BRITE.tar
  $ cd BRITE/    
  $ make all 
±àÒëÍê³É£¬ÔËÐÐBRITE
  $ ./brite &    
Ö÷ÒªµÄÎÊÌâ ......

LinuxÏÂTomcat 6.0.26 °²×°

ÎÒÓõÄÊÇ fedora 12 ×Ô´ýµÄjdk 1.6 ÔÚ /usr/lib/jvm/java-1.6.0-openjdk
µÚÒ»²½£º°Ñapache-tomcat-6.0.26.tar.gz½âѹºó·Åµ½/usr/local/ÏÂÖØÃüÃûΪapache-tomcat-6.0.26
µÚ¶þ²½£ºÔÚ/etc/profileÎļþÖÐÊʵ±µÄλÖÃÌí¼ÓÈçÏ»·¾³±äÁ¿
CATALINA_HOME=/usr/local/apache-tomcat-6.0.26
CATALINA_BASE=/usr/local/apache-tomcat ......

LinuxÃüÁîÕûÀí

LinuxÌṩÁË´óÁ¿µÄÃüÁÀûÓÃËü¿ÉÒÔÓÐЧµØÍê³É´óÁ¿µÄ¹¤×÷£¬Èç´ÅÅ̲Ù×÷¡¢Îļþ´æÈ¡¡¢Ä¿Â¼²Ù×÷¡¢½ø³Ì¹ÜÀí¡¢ÎļþȨÏÞÉ趨µÈ¡£ËùÒÔ£¬ÔÚLinuxϵͳÉϹ¤×÷Àë²»¿ªÊ¹ÓÃϵͳÌṩµÄÃüÁî¡£ÒªÏëÕæÕýÀí½âLinuxϵͳ£¬¾Í±ØÐë´ÓLinuxÃüÁîѧÆð£¬Í¨¹ý»ù´¡µÄÃüÁîѧϰ¿ÉÒÔ½øÒ»²½Àí½âLinuxϵͳ¡£
²»Í¬Linux·¢ÐаæµÄÃüÁîÊýÁ¿²»Ò»Ñù£¬µ«Linux·¢ÐÐ°æ± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ