[heshucheng@cssthost ccache-3.1.8]$ ls -al /bin/sh
lrwxrwxrwx 1 root root 4 Mar 22 10:43 /bin/sh -> bash
[heshucheng@cssthost ccache-3.1.8]$ man bash
[heshucheng@cssthost ccache-3.1.8]$ bash --version
GNU bash, version 4.2.39(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[heshucheng@cssthost ccache-3.1.8]$
先使用命令ls -al /bin/sh查看,一般是个链接文件,指向真实的bash,
通过man来查看bash的帮助文档,找到查看版本的参数--version,
然后通过bash --version来查看当前bash版本
或者直接sh --version也可以.
bash版本很多,linux标准bash是Bourne Again Shell
#!/bin/sh 个人理解是shell种类的说明和sh命令的路径
sh确实不是路径 是命令文件
/bin/sh是link到/bin/bash这个位置的.