首页 > 其他 > 详细

1.shell简介

时间:2014-03-05 08:11:17      阅读:497      评论:0      收藏:0      [点我收藏+]

一.Shell简介

LINUX/BSD 系统分成3个重要部分:核心,shell,工具程序


#vim hello.sh

#!/bin/bash

#这是我们的第一个程序hello.sh

echo ‘哈喽!bash shell

#chmod +x hello.sh


运行:

[root@pankuo shell]# bash hello.sh

哈喽!bash shell

[root@pankuo shell]#



clearlog.sh

#!/bin/bash

#这是我们的第一个有用的shell

cp /dev/null /var/log/messages


二.部署bash shell的环境

[root@pankuo shell]# echo $SHELL  查看当前shell

/bin/bash

[root@pankuo shell]# ls -al /bin/sh

lrwxrwxrwx. 1 root root 4 11 6 18:05 /bin/sh -> bash  

[root@pankuo shell]# echo $BASH_VERSION   查看shell版本

4.1.2(1)-release

[root@pankuo shell]#



自行编译最新版本的bash

举例

#tar  zxvf  bash-3.2.48.tar.gz     这个不是最新版的只做掩饰

#cd  bash-3.2.48

#./configure  --prefix=/home/ols3

#make

#make tests

#./bash

#echo $BASH_VERSION


安装

#su –

#make install

#su –c ‘make install’   这条命令系统会询问root密码,密码正确后会执行命令,执行完后会恢复到本身身份


切换使用新的bashshell

#su –

#vim /etc/shells

添加/usr/local/bin/bash



[root@pankuo shell]# chsh

Changing shell for root.

New shell [/bin/bash]:





本文出自 “linux_oracle” 博客,请务必保留此出处http://pankuo.blog.51cto.com/8651697/1367490

1.shell简介,布布扣,bubuko.com

1.shell简介

原文:http://pankuo.blog.51cto.com/8651697/1367490

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