shell脚本一:简单命令declare read ==

$ vi test1.sh

hello=hello/ /!/ how/ are/ you/ /?
echo $hello

输出

hello ! how are you ?

 

#!~/qsd/testShell
#
#date:2007/03/09
#written by qsd

name='qsd'

name1="qiushengdan $name"
name2='qiushengdan $name'
echo $name
echo $name1
echo $name2 

输出

qsd
qiushengdan qsd
qiushengdan $name

#!~/qsd/testShell
#
#qsd 2007 3 9

number1=3*2+6*9
declare -i number2=3*2+6*9
echo "your resulet --> $number1"
echo "your resulet --> $number2"

 

[dev@abtsvr shellTest]$ read name
qsd
[dev@abtsvr shellTest]$ echo $name
qsd

[dev@abtsvr shellTest]$ vi test3.sh

echo "please key in your name,and press enter to start."
read name
echo "this is your key in data --> $name"

[dev@abtsvr shellTest]$ sh test3.sh
please key in your name,and press enter to start.
asdf
this is your key in data --> asdf

[dev@abtsvr shellTest]$ sh test3.sh
please key in your name,and press enter to start.
asdf
this is your key in data --> asdf
[dev@abtsvr shellTest]$ vi test5.sh

echo "this is script's name ->$0"
echo "parameters  $1  $2  $3"

[dev@abtsvr shellTest]$ sh test5.sh 111 222 333
this is script's name ->test5.sh
parameters  111  222  333

 

你可能感兴趣的:(shell脚本一:简单命令declare read ==)