shell script

1 s1
#!/bin/sh
#set variable a
a="hello world!"
#print
echo "A is"
echo $a

2 s2
#!/bin/sh
num=2
echo "this is the $numnd"
echo "this is the ${num}nd"

3 s3
#!/bin/bash
a="my love"
echo $a
function func1(){
  local a="Tang Wei"
  echo $a
}
func1
echo $a

4 s4
#!/bin/sh
echo "number of parameters is "$#
echo "values of parameters is "$*
echo "the command is "$0
echo "value of para1 is "$1
echo "value of para2 is "$2

[root@localhost shell]# ./s4 1 2 3

 posted on 2013-04-14 11:23  Chenyong Liu  阅读(156)  评论(0)    收藏  举报