Posted on 2010-11-26 09:27 
幻海蓝梦 阅读(1433) 
评论(0)  编辑  收藏  所属分类: 
Linux 
			 
			
		 
		
set命令可以用来定制shell环境,使用选项“o”来打开或者关闭选项。例如打开选项:set -o
选项,关闭选项目:set +o 选项。
   
例如要打开vi交互式命令行编辑,则如下:
    
        
            | [root@localhost ~]#
            set -o  
            #查看当前设置情况allexport      
            off
 braceexpand    
            on
 emacs          
            on
 errexit        
            off
 errtrace       
            off
 functrace      
            off
 hashall        
            on
 histexpand     
            on
 history        
            on
 ignoreeof      
            off
 interactive-comments   
            on
 keyword        
            off
 monitor        
            on
 noclobber      
            off
 noexec         
            off
 noglob         
            off
 nolog          
            off
 notify         
            off
 nounset        
            off
 onecmd         
            off
 physical       
            off
 pipefail       
            off
 posix          
            off
 privileged     
            off
 verbose        
            off
 vi             
            off            
            #关闭中
 xtrace         
            off
 [root@localhost ~]# set -o
            vi   #把vi选项打开
 [root@localhost ~]# set
            -o     
            #查看当前设置情况
 allexport      
            off
 braceexpand    
            on
 emacs          
            off
 errexit        
            off
 errtrace       
            off
 functrace
 |