Shell ENV setup
时间:2009-07-07 来源:qiaodan211
In csh, we setup env using ifle .cshrc:
if ( -f $HOME/.mycshrc ) source $HOME/.mycshrc
setenv SYBASE /app/sybase/open_client
setenv SYBASE_ASE ASE-12_0
setenv SYBASE_OCS OCS-12_0
setenv LD_LIBRARY_PATH $SYBASE/OCS-12_0/lib:$SYBASE/ASE-12_0/lib:/usr/openwin/lib:$SYBASE/lib
setenv SYBASE_UTILS $SYBASE/OCS-12_0/bin foreach i ( /usr/bin /bin $SYBASE/OCS-12_0/bin $SYBASE/OCS-12_0/bin . )
set ifound = 0
foreach p ($path)
if ($p == $i) then
set ifound = 1
break
endif
end
if ( $ifound == 0 ) then
#echo "ADDED $i TO PATH"
set path=($i $path)
endif
end
set path=($path) After login with csh, we can check the env setup as below: #echo $SYBASE #echo $path
For changing the default login shell permanent, we can update the file /etc/passwd as below: root:x:0:0:Super-User:/:/sbin/sh -> root:x:0:0:Super-User:/:/sbin/csh For changing temporary: #ksh //Change to ksh #csh //Change to csh
setenv SYBASE /app/sybase/open_client
setenv SYBASE_ASE ASE-12_0
setenv SYBASE_OCS OCS-12_0
setenv LD_LIBRARY_PATH $SYBASE/OCS-12_0/lib:$SYBASE/ASE-12_0/lib:/usr/openwin/lib:$SYBASE/lib
setenv SYBASE_UTILS $SYBASE/OCS-12_0/bin foreach i ( /usr/bin /bin $SYBASE/OCS-12_0/bin $SYBASE/OCS-12_0/bin . )
set ifound = 0
foreach p ($path)
if ($p == $i) then
set ifound = 1
break
endif
end
if ( $ifound == 0 ) then
#echo "ADDED $i TO PATH"
set path=($i $path)
endif
end
set path=($path) After login with csh, we can check the env setup as below: #echo $SYBASE #echo $path
For changing the default login shell permanent, we can update the file /etc/passwd as below: root:x:0:0:Super-User:/:/sbin/sh -> root:x:0:0:Super-User:/:/sbin/csh For changing temporary: #ksh //Change to ksh #csh //Change to csh
相关阅读 更多 +