码迷,mamicode.com
首页 > 其他好文 > 详细

1. Bash 介绍

时间:2016-09-26 12:43:48      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:

你可以通过 $cat /etc/shells 来查看当前系统支持哪些shell类型。

[root@localhost log]# cat /etc/shells 
/bin/sh
/bin/bash
/sbin/nologin
/bin/dash

 

你默认的shell类型在/etc/passwd文件下

eye:x:500:500::/home/eye:/bin/bash

 

Bash是一个GNU Shell, 当它启动时,会去读他的启动配置文件

  • /etc/profile
  • ~/.bash_profile
  • ~/.bashrc

 

Shell 第一个案例

#!/bin/bash

clear

echo "The script starts now."

echo "Hi, $USER"
echo

echo "I will now fetch you a list of connected suers:"
echo 
w
echo

echo "I‘m setting two variables now."
COLOUR="black"
VALUE="9"
echo "This is a string: $COLOUR"
echo "And this is a number: $VALUE"
echo

echo "I‘m giving you back your prompt now."
echo

 

1. Bash 介绍

标签:

原文地址:http://www.cnblogs.com/elewei/p/5908327.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!