linux查看当前使用的shell,修改shell,shell编程?

来源:互联网 发布:ensp选择交换机端口 编辑:程序博客网 时间:2024/05/07 07:35

[root@localhost ~]# ls -l /bin/*sh
-rwxr-xr-x 1 root root 735004 2009-01-22 /bin/bash
lrwxrwxrwx 1 root root      4 08-31 13:44 /bin/csh -> tcsh
lrwxrwxrwx 1 root root     21 08-31 13:45 /bin/ksh -> /etc/alternatives/ksh
lrwxrwxrwx 1 root root      4 08-31 13:42 /bin/sh -> bash
-rwxr-xr-x 1 root root 346628 2010-03-31 /bin/tcsh

目前,我们常用的是bash
如何修改自己需要用到的解释shell呢??
chsh -s /bin/csh
[root@localhost eclipse]# chsh -s /bin/csh
Changing shell for root.
Shell changed.

如何查看目前使用的所哪种shell??env显示当前操作系统的环境变量。
[root@localhost ~]# env
SSH_AGENT_PID=2815
HOSTNAME=localhost.localdomain
DESKTOP_STARTUP_ID=
TERM=xterm
SHELL=/bin/bash
HISTSIZE=1000
KDE_NO_IPV6=1........


shell编程??就是利用shell的常用命令,写成类似于windows下的批处理文件。