首页 > 其他 > 详细

复制/etc/profile至/tmp/目录,用查找替换命令删除/tmp/profile文件中的行首的空白字符

时间:2021-02-08 10:43:49      阅读:30      评论:0      收藏:0      [点我收藏+]
[root@192 ~]# cp  /etc/profile /tmp/
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi
 
for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do
if [ -r "$i" ]; then
if [ "${-#*i}" != "$-" ]; then 
. "$i"     
else   
. "$i" >/dev/null 
fi     
fi 
done        
                
unset i     
unset -f pathmunge
 
if [ -n "${BASH_VERSION-}" ] ; then
if [ -f /etc/bashrc ] ; then 
# Bash login shells run only /etc/profile
# Bash non-login shells run only /etc/bashrc
# Check for double sourcing is done in /etc/bashrc.
. /etc/bashrc  
fi    
fi  
:% s@^[[:space:]]*@@g

复制/etc/profile至/tmp/目录,用查找替换命令删除/tmp/profile文件中的行首的空白字符

原文:https://www.cnblogs.com/catastrophe/p/14387264.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!