shell program 1

来源:互联网 发布:网络捕鱼电玩 编辑:程序博客网 时间:2024/06/04 19:32

(1)use gedit write the shell program"shell":

#! /bin/bash

echo please enter something:

read qq

echo you just enter : $qq

(2)change the document authority:

chmod +x shell

(3)run the shell:

./shell

(4)the result is:

please enter something:

12345

you just enter : 12345


this program show us:

1.the shell excute program is bash,the first sentence must be #! /bin/bash

2."echo" is use to print 

3."read" is use to assign variable

4.if you want to show the variable,you have to use "$" at front of  the variable


原创粉丝点击