nologin、sh、bash简介和执行说明

2015-08-10 22:14:00
admin
原创 2231
摘要:nologin、sh、bash简介和执行说明

一、nologin、sh、bash简介

查看linux支持的shell:cat /etc/shells

/bin/sh
/bin/bash
/sbin/nologin


查看shell实际情况:ls -l /bin/sh /bin/bash

/bin/bash

/bin/sh -> bash


查看当前的shell:echo $SHELL

/bin/bash


sh是Bourne shell的缩写,unix标准shell。

bash是GNU Bourne-Again SHell的缩写,linux标准shell。

并且:Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file.  Bash also incorporates useful features from the Korn and C shells (ksh and csh).


二、nologin、sh、bash执行说明

sh/bash [options] [file] //执行一个脚本,自动继承环境变量。

sh/bash [options] -c string //执行一个字符串,自动继承环境变量。

bash "hh.sh"

bash -c "ifconfig"

发表评论
评论通过审核之后才会显示。