<script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
/etc/profile
cat > /etc/profile << "EOF"
# Begin /etc/profile
for script in /etc/profile.d/*.sh
do
source $script
done
unset script
# End /etc/profile
EOF
install -d -m755 /etc/profile.d
05-i18n.sh
cat > /etc/profile.d/05-i18n.sh << "EOF"
# Begin /etc/profile.d/05-i18n.sh
export LANG=[ll]_[CC].[charset]
export G_FILENAME_ENCODING=@locale
# End /etc/profile.d/05-i18n.sh
EOF
10-path.sh
cat > /etc/profile.d/10-path.sh << "EOF"
# Begin /etc/profile.d/10-path.sh
if [ "$EUID" -eq 0 ]; then
export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
if [ -d "/usr/local/sbin" ]; then
export PATH="$PATH:/usr/local/sbin"
fi
else
export PATH="/bin:/usr/bin"
fi
if [ -d "/usr/local/bin" ]; then
export PATH="$PATH:/usr/local/bin"
fi
if [ -d "$HOME/bin" ]; then
export PATH="$HOME/bin:$PATH"
fi
# End /etc/profile.d/10-path.sh
EOF
10-pkg_config_path.sh (Multilib Only)
cat > /etc/profile.d/10-pkg_config_path.sh << "EOF"
# Begin /etc/profile.d/10-pkg_config_path.sh
export PKG_CONFIG_PATH32="/usr/lib/pkgconfig"
export PKG_CONFIG_PATHN32="/usr/lib32/pkgconfig"
export PKG_CONFIG_PATH64="/usr/lib64/pkgconfig"
# End /etc/profile.d/10-pkg_config_path.sh
EOF
10-xdg.sh
cat > /etc/profile.d/10-xdg.sh << "EOF"
# Begin /etc/profild.d/10-xdg.sh
export XDG_DATA_DIRS="/usr/share"
export XDG_CONFIG_DIRS="/etc/xdg:/usr/share"
# End /etc/profild.d/10-xdg.sh
EOF
15-xorg.sh
Change XORG_PREFIX
to wherever you are going to install Xorg to. Even if you are going to install Xorg6
make sure that XORG_PREFIX
is still set to the appropriate value.
Non-Multilib 15-xorg.sh
cat > /etc/profile.d/15-xorg.sh << "EOF"
# Begin /etc/profile.d/15-xorg.sh
export XORG_PREFIX=/usr/X11R7
export PATH="${PATH}:${XORG_PREFIX}/bin"
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}${XORG_PREFIX}/lib/pkgconfig"
export ACLOCAL="aclocal -I $XORG_PREFIX/share/aclocal"
# End /etc/profile.d/15-xorg.sh
EOF
Multilib 15-xorg.sh
cat > /etc/profile.d/15-xorg.sh << "EOF"
# Begin /etc/profile.d/15-xorg.sh
export XORG_PREFIX=/usr/X11R7
export PATH="${PATH}:${XORG_PREFIX}/bin"
export PKG_CONFIG_PATH32="${PKG_CONFIG_PATH32}${PKG_CONFIG_PATH32+:}${XORG_PREFIX}/lib/pkgconfig"
export PKG_CONFIG_PATHN32="${PKG_CONFIG_PATHN32}${PKG_CONFIG_PATHN32+:}${XORG_PREFIX}/lib32/pkgconfig"
export PKG_CONFIG_PATH64="${PKG_CONFIG_PATH64}${PKG_CONFIG_PATH64+:}${XORG_PREFIX}/lib64/pkgconfig"
export ACLOCAL="aclocal -I $XORG_PREFIX/share/aclocal"
# End /etc/profile.d/15-xorg.sh
EOF
50-dircolors.sh
cat > /etc/profile.d/50-dircolors.sh << "EOF"
# Begin /etc/profile.d/50-dircolors.sh
alias ls='ls --color=auto'
if [ -f "$HOME/.dircolors" ]; then
eval `dircolors -b "$HOME/.dircolors"`
else
if [ -f "/etc/dircolors" ]; then
eval `dircolors -b "/etc/dircolors"`
fi
fi
# End /etc/profile.d/50-dircolors.sh
EOF
To create /etc/dircolors run the following command:
dircolors -p > /etc/dircolors
50-history.sh
cat > /etc/profile.d/50-history.sh << "EOF"
# Begin /etc/profile.d/50-history.sh
export HISTSIZE=1000
export HISTIGNORE="&:[bf]g:exit"
# End /etc/profile.d/50-history.sh
EOF
50-prompt.sh
cat > /etc/profile.d/50-prompt.sh << "EOF"
# Begin /etc/profile.d/50-prompt.sh
export PS1="/u:/w/$ "
if [ "${TERM:0:5}" = "xterm" ]; then
export PS1="/[/e]2;/u@/H:: /w/a/]$PS1"
fi
shopt -s checkwinsize
# End /etc/profile.d/50-prompt.sh
EOF
If you're after a colorful PS1 try using /[/e[1;32m/]/u/[/e[1;33m/]@/[/e[1;31m/]/H /[/e[1;34m/]/w /[/e[1;32m/]/$ /[/e[0;0m/]
checkwinsize
forces bash to check the size of the window
at the end of each command. This is useful if you resized your terminal
while a command was running.
For a more comprehensive treatment of the Bash prompt, refer to the Bash Prompt HOWTO
50-readline.sh
cat > /etc/profile.d/50-readline.sh << "EOF"
# Begin /etc/profile.d/50-readline.sh
if [ -z "$INPUTRC" ]; then
if [ -f "$HOME/.inputrc" ]; then
export INPUTRC="$HOME/.inputrc"
else
if [ -f "/etc/inputrc" ]; then
export INPUTRC="/etc/inputrc"
fi
fi
fi
# End /etc/profile.d/50-readline.sh
EOF
50-umask.sh
cat > /etc/profile.d/50-umask.sh << "EOF"
# Begin /etc/profile.d/50-umask.sh
if [ "`id -un`" = "`id -gn`" -a $EUID -gt 99 ]; then
umask 002
else
umask 022
fi
# End /etc/profile.d/50-umask.sh
EOF
50-multilib.sh (For Multilib Only)
Non-Mips
cat > /etc/profile.d/50-multilib.sh << "EOF"
# Begin /etc/profile.d/50-multilib.sh
export BUILD32="-m32"
export BUILD64="-m64"
export CLFS_TARGET32="i686-pc-linux-gnu"
export LD_BUILD32="-m elf_i386"
export LD_BUILD64="-m elf_x86_64"
# End /etc/profile.d/50-multilib.sh
EOF
Adjust CLFS_TARGET32 to be the same as what was placed in ~clfs/.bashrc while building CLFS.
Adjust elf_i386 and elf_x86_64 accordingly for your architecture. If you're unsure what to set the value to see the output of:
ld --help | grep emulations
Mips
cat > /etc/profile.d/50-multilib.sh << "EOF"
# Begin /etc/profile.d/50-multilib.sh
export BUILD32="-mabi=32"
export BUILDN32="-mabi=n32"
export BUILD64="-mabi=64"
export LD_BUILD32=""
export LD_BUILDN32=""
export LD_BUILD64=""
# End /etc/profile.d/50-multilib.sh
EOF
分享到:
相关推荐
Bash启动库替换了.bashrc和.bash_profile,并简化了任何支持bash的系统上环境的设置。 无论您使用什么系统,它都会尝试提供相同的操作环境(默认情况下为GNU)。
git-bash.exe
bash官方手册/Bash Reference Manual
BASH官方文档,BASH官方文档,BASH官方文档
linux 服务器GNU Bash小于版本4.3有操作系统命令注入漏洞,需要对bash升级,下载解压 #tar zxvf bash-4.4.tar.gz #cd bash-4.4 #./configure (如果centos7编译失败,请先安装#yum install gcc) #make #make ...
bash 入门经典 不可不看哦 bash 入门经典 不可不看哦 bash 入门经典 不可不看哦
RHCERHCE bash RHCE bash RHCE bash RHCE bash RHCE bash RHCE bash RHCE bash bash
3.选中 Git Bash Here 右键新建(项),并重命名为command,command的值设置为 D:\Program Files\Git\bin\bash.exe --login -i,其中--login和i之间有空格,bash.exe和--login之间也有空格 4.在shell目录右键->...
官方的bash手册 讲述bash脚本语法规范 和linux相关配置 很好的资料
Finding Files: Find, Locate, Slocate Chapter 10. Additional Features For Scripting Chapter 11. Working With Dates And Times Chapter 12. End-User Tasks As Shell Scripts Chapter 13. Parsing And Similar...
bash-3.0-27.0.3.el4.i386.rpm bash-debuginfo-3.0-27.el4.4.i386.rpm 2、rhel 4.x 64位 bash-3.0-27.el4.x86_64.rpm bash-debuginfo-3.0-27.el4.4.x86_64.rpm 3、centos5.x_32 bash-3.2-33.el5.1.i386.rpm bash-3.2...
redhat bash漏洞补丁包含文件:bash-4.1.2-15.el6_5.2.i686.rpmbash-4.1.2-15.el6_5.2.x86_64.rpmbash-3.0-27.el4.i386.rpmbash-3.0-27.el4.x86_64.rpmbash-3.2-33.el5_11.4.i386.r... redhat bash漏洞补丁 包含文件...
Bash使用
bash.bash_logout888
鉴于目前绝大部分服务器因为没有注册的yum或者因不通外网等问题导致无法使用yum update -y bash 命令进行漏洞修复,如采用RPM包升级修复漏洞又存在各服务器系统有的是32位有的是64位或者bash的版本不一样导致需要...
计算机泰斗从0开始教你bash编程 包含全部的教程和源码
bash入门学习实例
linux平台的bash shell开发帮助文档(手册),英文版,版本4.2。日常开发shell翻阅, 章节如下: Definitions:: Some definitions used i n the rest of this manual. Basic Shell Features:: The shell "building ...
Bash参考手册 pdf文档 学习Bash的必备电子书
bash基本的配置文件示例 可控制bash基本属性