| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> perl >> gong neng feng fu de Perl:Perl zi dong hua xi tong guan li

gong neng feng fu de Perl:Perl zi dong hua xi tong guan li

2008-05-19 06:25:56 编辑來源:互联网 评论
 
 
 
本文为【功能丰富的Perl:Perl自动化系统管理】的拼音翻译版
  UNIX xi tong guan li zong shi yi ge ji shou de wen ti , yun yong zheng que de gong ju hui shi zhe ge wen ti bian de rong yi 。 zai zhe yi bu fen zhong ,Teodor ti chu le guan yu shi yong Perl lai jian hua he lao gu xi tong guan li de xiang fa 。 zai zhe zhong huan jing zhong , xi tong pei zhi yin qing cfengine shi yi ge ji qi chong yao de gong ju 。
  yao wan cheng ben wen zhong de lian xi , xi tong zhong bi xu an zhuang le Perl 5.6.0。 cao zuo xi tong zui hao shi zhu liu UNIX an zhuang (Linux、Solaris、BSD) de zui jin ban ben (2000 huo geng xin )。 zai jiao zao ban ben de Perl he UNIX yi ji qi ta cao zuo xi tong shang ye ke yi shi yong ben wen zhong de shi li , dan ying dang jiang ke neng de gong neng gu zhang zuo wei lian xi lai jie jue 。
  UNIX guan li ju you tiao zhan xing de yi da yuan yin shi mei ge UNIX gong ying shang ren wei biao zhun shi zhen dui di neng sha gua 。 suo yi , ji shi shi tong yi gong ying shang de cao zuo xi tong (SunOS 4.x he Solaris 5.x) ye ke yi shi gen ben bu tong 。 zai mou xie qing kuang xia , shen zhi gen ben mei you gong ying shang 。 li ru ,Linux mei you dan du de gong ying shang ( sui ran Red Hat mu qian shi zui da de Linux fen fa ban ), mei yi ge ban ben de Linux dou you qi du dao zhi chu 。 ru guo POSIX biao zhun hua zuo de zheng que , na me ta shi jie jue zhe yi wen ti de zheng que fang xiang shang de yi ge bu zhou 。 yi han de shi , ta zhi neng bao zheng xi tong guan li suo xu gong neng de yi ge xiao de zi ji 。
  zheng ru wo jing chang suo shuo : le jie nin de gong ju 。 ru guo shi tu jin yong yi zhong gong ju 、 yu yan 、 huo fang fa zuo mei jian shi qing , ke neng shi yi chang e meng 。 yao ju you ling huo xing 。
  ru guo cun zai yi ge xi tong guan li gong li , na jiu shi : liang ci guo hou , mei you xi tong guan li ren wu shi you qu de 。 ru guo nin fa xian zheng zai chong fu zuo dan tiao er ku zao de shi , na me zi dong hua ta 。 dang ran , you shi hen nan zi dong hua , dan ying gai zhi shao kao lv zhe ge wen ti , bing qie quan heng qi you shi ji zi dong hua suo hua fei de shi jian 。
  cfengine gong ju
  ru guo nin dui zi dong hua xi tong guan li shi ren zhen de , na me ying gai le jie cfengine gong ju 。 jin dang nin ning yuan ba shi jian dou hua zai vi bian ji qi shi , ke yi bu qu le jie cfengine。
  cfengine shi yi zhong xi tong pei zhi yin qing 。 ta huo qu pei zhi jiao ben zuo wei shu ru , ran hou gen ju zhe xie jiao ben lai xing dong 。 mu qian ban ben shi 1.6.3( fei chang wen ding de fa xing ban ), er qie ban ben 2.0 ye hu zhi yu chu 。 you guan cfengine kai fa de geng duo xin xi , qing fang wen cfengine wang zhan ( qing shen yue ben wen hou mian de shen kao zi liao )。
  bu yi ding yao yong cfengine ti gong nin de suo you dong xi , er qie nin bu ke neng li ke xu yao suo you dong xi 。 yi kai shi shi , nin de cfengine pei zhi wen jian ying gai hen jian dan , bing qie sui zhe fa xian geng duo dong xi xi wang zi dong hua er zeng chang 。
  lai zi cfengine ming ling shen kao da quan , zhe li you qi zui zhi de zhu yi de te xing :
  ke yi jian kong he xiu gai wen jian xu ke quan he ACL。 li ru ,/etc/shadow ke yi yu 0400/root/sys xu ke quan bao chi yi zhi , er qie ru guo na xie xu ke quan fa sheng bian hua , ke yi jing gao xi tong guan li yuan huo ji ke jiu zheng ta men 。
  gen ju xiang ying fstab bian hua , ke zi dong an zhuang he xie zai NFS wen jian 。
  ke yi tong guo dan yi wen jian lai guan li zi wang yan ma 、DNS pei zhi 、 que sheng lu you he zhu wang luo jie kou ;
  wen jian he mu lu ke yi di gui fu zhi zhi ling yi wei zhi , yao me ben di fu zhi , yao me cong yuan cheng fu wu qi fu zhi 。
  ke yi bian ji ( zhe shi yi ge fei chang qiang da de te xing , ti gong le zheng ze biao da shi he quan ju cha zhao / ti huan )、 lun zhuan ( pi ru , ri zhi wen jian ) huo shan chu wen jian 。
  ke yi lian jie wen jian ( dan yi de he / huo mu lu xia de suo you wen jian huo yu zheng ze biao da shi pi pei de wen jian ) he zheng ge mu lu 。
  ke yi gen ju jin cheng biao zhong zheng ze biao da shi de pi pei lai qi dong 、 sha si 、 chong qi jin cheng huo fa song ren yi xin hao 。
  ke yi yun xing ren yi ming ling 。
  shang shu suo you zhe xie gen ju cao zuo xi tong lei xing he xiu ding ban ben 、 yi tian zhong de shi jian 、 ren yi yong hu ding yi de lei 、 wen jian zhong wen jian 、 mu lu huo shu ju de you wu deng deng ke yi shi you tiao jian de 。
  ji shi yong Perl ke yi zuo cfengine suo zuo de suo you shi qing , wei shen me yao cong tou kai shi ne ? li ru , ru guo xiang yong ling yi ge ci ti huan mou ge ci , bian ji wen jian ke yi shi jian dan de yi xing cheng xu 。 dang kai shi yuan xu xi tong de zi lei xing 、 luo ji xi tong bu fen yi ji suo you qi ta duo xiang yin su shi , zhe yi xing cheng xu hui bian cheng 300 xing 。 wei shen me bu zai cfengine zhong zuo ne ? ta chan sheng 100 xing ke du de pei zhi dai ma 。
  gen ju wo zi ji de jing yan , yin wei ke yi cong zui xiao pei zhi wen jian kai shi , ran hou sui zhe shi jian liu shi zhu bu di xiang cfengine tian jia yi xie dong xi , suo yi jiang cfengine jie shao gei zhan dian shi hen rong yi de 。 mei you ren xi huan tu ran de bian hua , suo you xi tong guan li yuan geng shi ru ci ( yin wei ru guo ren he shi chu cuo , ta men li suo dang ran di hui shou dao ze nan )。
  pei zhi wen jian guan li
  guan li pei zhi wen jian shi jian ku de 。 ke yi tong guo kao lv cfengine shi fou sheng ren gai ren wu kai shi 。 yi han de shi ,cfengine de bian ji shi mian xiang xing de , suo yi ta ke neng bu tai shi he fu duo de pei zhi wen jian 。 dan dui yu ru TCP bao zhuang qi pei zhi wen jian /etc/hosts.allow na yang de jian dan wen jian cfengine shi zui shi he de 。
  tong chang , xi wang bao liu pei zhi wen jian de duo ge ban ben 。 pi ru , ke neng xu yao zai /etc/resolv.conf zhong you liang zu DNS pei zhi she zhi , yi zu shi yong yu wai bu ji qi , ling yi zu shi yong yu nei bu ji qi 。 hen zi ran , wai bu DNS resolv.conf ke yi jin ru cheng wei "external" de mu lu , er nei bu resolv.conf ke yi jin ru xiang ying de "internal" mu lu 。 rang wo men jia ding zhe liang ge mu lu dou zai yi ge quan ju "spec" mu lu xia , gai mu lu shi pei zhi wen jian de yi zhong gen mu lu 。
  xia lie dai ma hui bian li spec mu lu , sou suo shi he yu gei ding ji qi de wen jian ming 。 ta jiang cong /usr/local/spec kai shi , ran hou wang xia , xun zhao yu qing qiu xiang pi pei de wen jian 。 er qie , ta jiang jian cha mei ge mu lu de ming cheng shi fou yu shu yu mou xie ji qi de lei xiang tong 。 yin ci , ru guo wo men qing qiu locate_global('resolv.conf', 'wonka'), gai han shu jiang zai /usr/local/spec mu lu xia cha zhao resolv.conf wen jian , gai wen jian yao me zai gen mu lu xia , yao me zai gai gen mu lu de zi mu lu xia , ta de ming cheng ying yu "wonka" ji qi suo shu de lei xiang pi pei 。 suo yi , ru guo "wonka" shu yu "chocolate" lei , bing qie ru guo you /usr/local/spec/chocolate/resolv.conf wen jian , na me locate_global() jiang fan hui "/usr/local/spec/chocolate/resolv.conf"。
  ru guo locate_global() zhao dao yu wen jian xiang pi pei de duo ge ban ben ( pi ru ,/usr/local/spec/chocolate/resolv.conf he /usr/local/spec/resolv.conf), ze ta hui fang qi 。 zhe li jia she mei you pei zhi bi you liang ge cuo wu zhi yi yao hao 。 huan you , qing zhu yi , ji qi ke yi shu yu bu zhi yi ge lei 。
  ke yi gou jian zhe yang de jie gou 。 pi ru ,
  /usr/local/spec/external/chocolate/resolv.conf
  /usr/local/spec/internal/chocolate/resolv.conf
  /usr/local/spec/external/sugar/resolv.conf
  /usr/local/spec/internal/sugar
  jiang bao han wai bu he nei bu "chocolate" yi ji "sugar" ji qi de wen jian 。 zhi xu yao zheng que di she zhi your machine_belongs_to_class() han shu 。
  yi dan locate_global() fan hui yi ge wen jian ming , jiang ta yong scp huo rsync fu zhi zhi yuan cheng xi tong shi xiang dang jian dan de 。 qing ji zhu , zong shi yao bao chi gai wen jian de xu ke quan he shu xing 。scp xu yao "-p" biao zhi ,rsync xu yao "-a" biao zhi 。 cha yue xiang yao shi yong de wen jian fu zhi ming ling de wen dang 。 zhe yang jiu you le yi ge tong yi de pei zhi wen jian shu 。
  qing dan 1:Spec mu lu bian li
  # {{{ locate_global: use spec directory to find a file matching the current class
  sub locate_global($$)
  {
  # this code uses File::Find
  my $spec_dir = '/usr/local/spec';
  my $file = shift || return undef;
  # file name sought
  my $machine = shift || return undef;
  # machine name
  my @matches;
  my $find_sub =
  sub
  {
  print "found file $_\n";
  push @matches, $File::Find::name if ($_ eq $file);
  # the machine_belongs_to_class sub returns true if a machine
  # belongs to a class; we stop traversing down otherwise
  $File::Find::prune = 1 unless
  machine_belongs_to_class($machine, $_) || $_ eq '.';
  };
  find($find_sub, $spec_dir);
  if (scalar @matches 1)
  {
  print "More than one match for file $file,",
  "machine $machine found: @matches\n" ;
  return undef;
  }
  elsif (scalar @matches == 1)
  {
  return $matches[0];
  # this is the right match
  }
  else {
  return undef;
  # no files found
  }
  }
  # }}}
  yi dan jian li le zhe zhong /usr/local/spec jie gou de yi ge wen ti shi : wo men zen me zhi dao resolv.conf ying dang jin ru /etc? yao me mei you ru zhe li suo shi de piao liang ceng ci jie gou , gai xie ta ( pi ru , yong "+" ti dai "/" - yi zhong wei xian de he you dian chou lou de fang fa ), yao me zai lian jie ming yu zhen shi ming zhi jian bao chi dan du de yang she 。 pi ru ,"root-profile" ke yi shi "~root/.profile" de lian jie ming 。 zui hou yi zhong fang fa , ye shi wo xi huan de fang fa , you yu ta ping pu wen jian ming bing qie xiao chu le you yin cang wen jian ming de wen ti 。 zai yi ge mu lu jie gou xia , mei yi yang dou shi ke jian de he zheng jie de 。 dang ran , mei ci zai jiang wen jian tian jia dao lie biao shi , xu yao duo zuo yi xie gong zuo 。 cheng xu bi xu zhi dao "resolv.conf" ying gai fu zhi dao yuan cheng xi tong de "/etc/resolv.conf", bing qie "dfstab" ying gai jin ru "/etc/dfs/dfstab"( gong xiang NFS wen jian xi tong de Solaris wen jian )。
  yi dan she zhi wan spec mu lu ceng ci jie gou , xian zai rang wo men tao lun ke yi zuo shen me 。 ru guo xiang zuo , ke yi cha zhao suo you ming wei Joe de yong hu :
  qing dan 2: cha zhao suo you password wen jian bing yong grep zhao chu Joe
  grep Joe `find /usr/local/spec -name passwd`
  huo zhe ke yi shi yong gong ju , ru rep.pl( lian jie dao rep.pl), you David Pitts bian xie , lai yong ling yi ge ci ti huan mei yi ge ci :
  qing dan 3: cha zhao suo you host wen jian bing jiang "wonka" gai cheng "willy"
  find /usr/local/spec -name hosts -exec rep.pl wonka willy {} \;
  xian zai , ru guo yuan yi , ke yi yong Perl bian xie qing dan 2 he 3;find2perl jiu shi wei ci bian xie de shi yong cheng xu 。 sui ran ta fei chang jian dan , cong kai shi zhi shi yong find。 ta zhen de shi ji hao de shi yong cheng xu , mei ge xi tong guan li yuan dou ying gai shi yong 。
  【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
  UNIX xi tong guan li zong shi yi ge ji shou de wen ti , yun yong zheng que de gong ju hui shi zhe ge wen ti bian de rong yi 。 zai zhe yi bu fen zhong ,Teodor ti chu le guan yu shi yong Perl lai jian hua he lao gu xi tong guan li de xiang fa 。 zai zhe zhong huan jing zhong , xi tong pei zhi yin qing cfengine shi yi ge ji qi chong yao de gong ju 。    yao wan cheng ben wen zhong de lian xi , xi tong zhong bi xu an zhuang le Perl 5.6.0。 cao zuo xi tong zui hao shi zhu liu UNIX an zhuang (Linux、Solaris、BSD) de zui jin ban ben (2000 huo geng xin )。 zai jiao zao ban ben de Perl he UNIX yi ji qi ta cao zuo xi tong shang ye ke yi shi yong ben wen zhong de shi li , dan ying dang jiang ke neng de gong neng gu zhang zuo wei lian xi lai jie jue 。   UNIX guan li ju you tiao zhan xing de yi da yuan yin shi mei ge UNIX gong ying shang ren wei biao zhun shi zhen dui di neng sha gua 。 suo yi , ji shi shi tong yi gong ying shang de cao zuo xi tong (SunOS 4.x he Solaris 5.x) ye ke yi shi gen ben bu tong 。 zai mou xie qing kuang xia , shen zhi gen ben mei you gong ying shang 。 li ru ,Linux mei you dan du de gong ying shang ( sui ran Red Hat mu qian shi zui da de Linux fen fa ban ), mei yi ge ban ben de Linux dou you qi du dao zhi chu 。 ru guo POSIX biao zhun hua zuo de zheng que , na me ta shi jie jue zhe yi wen ti de zheng que fang xiang shang de yi ge bu zhou 。 yi han de shi , ta zhi neng bao zheng xi tong guan li suo xu gong neng de yi ge xiao de zi ji 。    zheng ru wo jing chang suo shuo : le jie nin de gong ju 。 ru guo shi tu jin yong yi zhong gong ju 、 yu yan 、 huo fang fa zuo mei jian shi qing , ke neng shi yi chang e meng 。 yao ju you ling huo xing 。    ru guo cun zai yi ge xi tong guan li gong li , na jiu shi : liang ci guo hou , mei you xi tong guan li ren wu shi you qu de 。 ru guo nin fa xian zheng zai chong fu zuo dan tiao er ku zao de shi , na me zi dong hua ta 。 dang ran , you shi hen nan zi dong hua , dan ying gai zhi shao kao lv zhe ge wen ti , bing qie quan heng qi you shi ji zi dong hua suo hua fei de shi jian 。   cfengine gong ju    ru guo nin dui zi dong hua xi tong guan li shi ren zhen de , na me ying gai le jie cfengine gong ju 。 jin dang nin ning yuan ba shi jian dou hua zai vi bian ji qi shi , ke yi bu qu le jie cfengine。   cfengine shi yi zhong xi tong pei zhi yin qing 。 ta huo qu pei zhi jiao ben zuo wei shu ru , ran hou gen ju zhe xie jiao ben lai xing dong 。 mu qian ban ben shi 1.6.3( fei chang wen ding de fa xing ban ), er qie ban ben 2.0 ye hu zhi yu chu 。 you guan cfengine kai fa de geng duo xin xi , qing fang wen cfengine wang zhan ( qing shen yue ben wen hou mian de shen kao zi liao )。    bu yi ding yao yong cfengine ti gong nin de suo you dong xi , er qie nin bu ke neng li ke xu yao suo you dong xi 。 yi kai shi shi , nin de cfengine pei zhi wen jian ying gai hen jian dan , bing qie sui zhe fa xian geng duo dong xi xi wang zi dong hua er zeng chang 。    lai zi cfengine ming ling shen kao da quan , zhe li you qi zui zhi de zhu yi de te xing :    ke yi jian kong he xiu gai wen jian xu ke quan he ACL。 li ru ,/etc/shadow ke yi yu 0400/root/sys xu ke quan bao chi yi zhi , er qie ru guo na xie xu ke quan fa sheng bian hua , ke yi jing gao xi tong guan li yuan huo ji ke jiu zheng ta men 。    gen ju xiang ying fstab bian hua , ke zi dong an zhuang he xie zai NFS wen jian 。    ke yi tong guo dan yi wen jian lai guan li zi wang yan ma 、DNS pei zhi 、 que sheng lu you he zhu wang luo jie kou ;    wen jian he mu lu ke yi di gui fu zhi zhi ling yi wei zhi , yao me ben di fu zhi , yao me cong yuan cheng fu wu qi fu zhi 。    ke yi bian ji ( zhe shi yi ge fei chang qiang da de te xing , ti gong le zheng ze biao da shi he quan ju cha zhao / ti huan )、 lun zhuan ( pi ru , ri zhi wen jian ) huo shan chu wen jian 。    ke yi lian jie wen jian ( dan yi de he / huo mu lu xia de suo you wen jian huo yu zheng ze biao da shi pi pei de wen jian ) he zheng ge mu lu 。    ke yi gen ju jin cheng biao zhong zheng ze biao da shi de pi pei lai qi dong 、 sha si 、 chong qi jin cheng huo fa song ren yi xin hao 。    ke yi yun xing ren yi ming ling 。    shang shu suo you zhe xie gen ju cao zuo xi tong lei xing he xiu ding ban ben 、 yi tian zhong de shi jian 、 ren yi yong hu ding yi de lei 、 wen jian zhong wen jian 、 mu lu huo shu ju de you wu deng deng ke yi shi you tiao jian de 。    ji shi yong Perl ke yi zuo cfengine suo zuo de suo you shi qing , wei shen me yao cong tou kai shi ne ? li ru , ru guo xiang yong ling yi ge ci ti huan mou ge ci , bian ji wen jian ke yi shi jian dan de yi xing cheng xu 。 dang kai shi yuan xu xi tong de zi lei xing 、 luo ji xi tong bu fen yi ji suo you qi ta duo xiang yin su shi , zhe yi xing cheng xu hui bian cheng 300 xing 。 wei shen me bu zai cfengine zhong zuo ne ? ta chan sheng 100 xing ke du de pei zhi dai ma 。    gen ju wo zi ji de jing yan , yin wei ke yi cong zui xiao pei zhi wen jian kai shi , ran hou sui zhe shi jian liu shi zhu bu di xiang cfengine tian jia yi xie dong xi , suo yi jiang cfengine jie shao gei zhan dian shi hen rong yi de 。 mei you ren xi huan tu ran de bian hua , suo you xi tong guan li yuan geng shi ru ci ( yin wei ru guo ren he shi chu cuo , ta men li suo dang ran di hui shou dao ze nan )。    pei zhi wen jian guan li    guan li pei zhi wen jian shi jian ku de 。 ke yi tong guo kao lv cfengine shi fou sheng ren gai ren wu kai shi 。 yi han de shi ,cfengine de bian ji shi mian xiang xing de , suo yi ta ke neng bu tai shi he fu duo de pei zhi wen jian 。 dan dui yu ru TCP bao zhuang qi pei zhi wen jian /etc/hosts.allow na yang de jian dan wen jian cfengine shi zui shi he de 。    tong chang , xi wang bao liu pei zhi wen jian de duo ge ban ben 。 pi ru , ke neng xu yao zai /etc/resolv.conf zhong you liang zu DNS pei zhi she zhi , yi zu shi yong yu wai bu ji qi , ling yi zu shi yong yu nei bu ji qi 。 hen zi ran , wai bu DNS resolv.conf ke yi jin ru cheng wei "external" de mu lu , er nei bu resolv.conf ke yi jin ru xiang ying de "internal" mu lu 。 rang wo men jia ding zhe liang ge mu lu dou zai yi ge quan ju "spec" mu lu xia , gai mu lu shi pei zhi wen jian de yi zhong gen mu lu 。    xia lie dai ma hui bian li spec mu lu , sou suo shi he yu gei ding ji qi de wen jian ming 。 ta jiang cong /usr/local/spec kai shi , ran hou wang xia , xun zhao yu qing qiu xiang pi pei de wen jian 。 er qie , ta jiang jian cha mei ge mu lu de ming cheng shi fou yu shu yu mou xie ji qi de lei xiang tong 。 yin ci , ru guo wo men qing qiu locate_global('resolv.conf', 'wonka'), gai han shu jiang zai /usr/local/spec mu lu xia cha zhao resolv.conf wen jian , gai wen jian yao me zai gen mu lu xia , yao me zai gai gen mu lu de zi mu lu xia , ta de ming cheng ying yu "wonka" ji qi suo shu de lei xiang pi pei 。 suo yi , ru guo "wonka" shu yu "chocolate" lei , bing qie ru guo you /usr/local/spec/chocolate/resolv.conf wen jian , na me locate_global() jiang fan hui "/usr/local/spec/chocolate/resolv.conf"。    ru guo locate_global() zhao dao yu wen jian xiang pi pei de duo ge ban ben ( pi ru ,/usr/local/spec/chocolate/resolv.conf he /usr/local/spec/resolv.conf), ze ta hui fang qi 。 zhe li jia she mei you pei zhi bi you liang ge cuo wu zhi yi yao hao 。 huan you , qing zhu yi , ji qi ke yi shu yu bu zhi yi ge lei 。    ke yi gou jian zhe yang de jie gou 。 pi ru ,   /usr/local/spec/external/chocolate/resolv.conf   /usr/local/spec/internal/chocolate/resolv.conf   /usr/local/spec/external/sugar/resolv.conf   /usr/local/spec/internal/sugar    jiang bao han wai bu he nei bu "chocolate" yi ji "sugar" ji qi de wen jian 。 zhi xu yao zheng que di she zhi your machine_belongs_to_class() han shu 。    yi dan locate_global() fan hui yi ge wen jian ming , jiang ta yong scp huo rsync fu zhi zhi yuan cheng xi tong shi xiang dang jian dan de 。 qing ji zhu , zong shi yao bao chi gai wen jian de xu ke quan he shu xing 。scp xu yao "-p" biao zhi ,rsync xu yao "-a" biao zhi 。 cha yue xiang yao shi yong de wen jian fu zhi ming ling de wen dang 。 zhe yang jiu you le yi ge tong yi de pei zhi wen jian shu 。    qing dan 1:Spec mu lu bian li   # {{{ locate_global: use spec directory to find a file matching the current class   sub locate_global($$)   {   # this code uses File::Find   my $spec_dir = '/usr/local/spec';   my $file = shift || return undef;   # file name sought   my $machine = shift || return undef;   # machine name   my @matches;   my $find_sub =   sub   {   print "found file $_\n";   push @matches, $File::Find::name if ($_ eq $file);   # the machine_belongs_to_class sub returns true if a machine   # belongs to a class; we stop traversing down otherwise   $File::Find::prune = 1 unless   machine_belongs_to_class($machine, $_) || $_ eq '.';   };   find($find_sub, $spec_dir);   if (scalar @matches 1)   {   print "More than one match for file $file,",   "machine $machine found: @matches\n" ;   return undef;   }   elsif (scalar @matches == 1)   {   return $matches[0];   # this is the right match   }   else {   return undef;   # no files found   }   }   # }}}    yi dan jian li le zhe zhong /usr/local/spec jie gou de yi ge wen ti shi : wo men zen me zhi dao resolv.conf ying dang jin ru /etc? yao me mei you ru zhe li suo shi de piao liang ceng ci jie gou , gai xie ta ( pi ru , yong "+" ti dai "/" - yi zhong wei xian de he you dian chou lou de fang fa ), yao me zai lian jie ming yu zhen shi ming zhi jian bao chi dan du de yang she 。 pi ru ,"root-profile" ke yi shi "~root/.profile" de lian jie ming 。 zui hou yi zhong fang fa , ye shi wo xi huan de fang fa , you yu ta ping pu wen jian ming bing qie xiao chu le you yin cang wen jian ming de wen ti 。 zai yi ge mu lu jie gou xia , mei yi yang dou shi ke jian de he zheng jie de 。 dang ran , mei ci zai jiang wen jian tian jia dao lie biao shi , xu yao duo zuo yi xie gong zuo 。 cheng xu bi xu zhi dao "resolv.conf" ying gai fu zhi dao yuan cheng xi tong de "/etc/resolv.conf", bing qie "dfstab" ying gai jin ru "/etc/dfs/dfstab"( gong xiang NFS wen jian xi tong de Solaris wen jian )。    yi dan she zhi wan spec mu lu ceng ci jie gou , xian zai rang wo men tao lun ke yi zuo shen me 。 ru guo xiang zuo , ke yi cha zhao suo you ming wei Joe de yong hu :    qing dan 2: cha zhao suo you password wen jian bing yong grep zhao chu Joe   grep Joe `find /usr/local/spec -name passwd`    huo zhe ke yi shi yong gong ju , ru rep.pl( lian jie dao rep.pl), you David Pitts bian xie , lai yong ling yi ge ci ti huan mei yi ge ci :    qing dan 3: cha zhao suo you host wen jian bing jiang "wonka" gai cheng "willy"   find /usr/local/spec -name hosts -exec rep.pl wonka willy {} \;    xian zai , ru guo yuan yi , ke yi yong Perl bian xie qing dan 2 he 3;find2perl jiu shi wei ci bian xie de shi yong cheng xu 。 sui ran ta fei chang jian dan , cong kai shi zhi shi yong find。 ta zhen de shi ji hao de shi yong cheng xu , mei ge xi tong guan li yuan dou ying gai shi yong 。   
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
赏心悦目的模特儿(9)
赏心悦目的模特儿(8)
赏心悦目的模特儿(7)
赏心悦目的模特儿(6)
周六一日游--绿野翠蜂场(一)
骆驼峰
下一站上环
杂乱的几张Danang
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有