linux getÏÂÁîÔõôÓÃ
get ÏÂÁîÓÃÓÚÔÚ linux ÖлñÈ¡ºÍÉèÖÃϵͳ±äÁ¿µÄÖµ£¨°üÀ¨ÇéÐαäÁ¿£©£¬ÌṩÒÔϹ¦Ð§£º»ñÈ¡±äÁ¿Öµ¡£ÉèÖñäÁ¿Öµ£¨½ö¶ÔÄ¿½ñ»á»°ÓÐÓã©¡£ÒÔÐÐÁбíÐÎʽÁгöËùÓÐÇéÐαäÁ¿¼°ÆäÖµ¡£
Linux get ÏÂÁÓ÷¨ÓëʾÀý
get ÏÂÁîÓÃÓÚÔÚ Linux ÖлñÈ¡ºÍÉèÖÃϵͳ±äÁ¿µÄÖµ¡£Ëüͨ¹ýʹÓõײãµÄÇéÐαäÁ¿ºÍÉèÖÃÎļþÀ´ÊµÏִ˹¦Ð§¡£
Ó÷¨£º
get [Ñ¡Ïî] ±äÁ¿Ãû
Ñ¡Ï
-h£ºÏÔʾ×ÊÖúÐÅÏ¢¡£
-s£º´Ë±ê¼ÇÒÖÖƱê×¼Êä³ö£¬½ö·µ»Ø±äÁ¿Öµ¡£
-p£º»ñÈ¡±äÁ¿Öµ²¢½«Æä´òÓ¡µ½±ê×¼Êä³ö¡£
-l£ºÒÔÐÐÁбíµÄÐÎʽÁгöËùÓÐÇéÐαäÁ¿¼°ÆäÖµ¡£
ʾÀý£º
1. »ñÈ¡±äÁ¿Öµ£º
$ get USER demo
µÇ¼ºó¸´ÖÆ
2. »ñÈ¡±äÁ¿Öµ²¢´òÓ¡µ½±ê×¼Êä³ö£º
$ get -p USER demo
µÇ¼ºó¸´ÖÆ
3. ÒÔÐÐÁбíÐÎʽÁгöÇéÐαäÁ¿£º
$ get -l LANG=en_US.UTF-8 USER=demo HOME=/home/demo
µÇ¼ºó¸´ÖÆ
4. ÉèÖñäÁ¿Öµ£º
ËäÈ» get ÏÂÁîÖ÷ÒªÓÃÓÚ»ñÈ¡±äÁ¿Öµ£¬µ«ËüÒ²¿ÉÒÔʹÓà -s Ñ¡ÏîÉèÖñäÁ¿Öµ¡£
$ get -s USER="new_user"
µÇ¼ºó¸´ÖÆ
×¢ÖØ£º
get ÏÂÁî²Ù×÷ÇéÐαäÁ¿£¬¶ø²»ÊÇÉèÖÃÎļþ¡£
ʹÓà -s Ñ¡ÏîÉèÖñäÁ¿ÖµÊ±£¬¸Ã¸ü¸Ä½ö¶ÔÄ¿½ñ»á»°ÓÐÓá£ÒªÓÀÊÀ¸ü¸Ä±äÁ¿Öµ£¬Çë±à¼ÏìÓ¦µÄÉèÖÃÎļþ£¨ÀýÈç /etc/environment£©¡£
get ÏÂÁî¿ÉÒÔÓëÆäËûÏÂÁîÍŽáʹÓã¬ÀýÈç grep »ò awk£¬ÒÔ´¦ÀíºÍ¹ýÂ˱äÁ¿Öµ¡£
ÒÔÉϾÍÊÇlinux getÏÂÁîÔõôÓõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡