dirname-basename

[root@web02-7 ~]# cat /server/scripts/dir_base.sh 
#!/bin/bash
dirname $0
basename $0

 

[root@web02-7 ~]# sh /server/scripts/dir_base.sh
/server/scripts
dir_base.sh

 

[root@web02-7 scripts]# echo \${1..12}
$1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12
[root@web02-7 scripts]# echo \${1..12} >test.sh
[root@web02-7 scripts]# cat test.sh 
#!/bin/bash
echo $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12
[root@web02-7 scripts]# sh test.sh {a..z}
a b c d e f g h i a0 a1 a2
[root@web02-7 scripts]# cat test.sh 
#!/bin/bash
echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12}
[root@web02-7 scripts]# sh test.sh {a..z}
a b c d e f g h i j k l

  

  

  

posted @ 2017-02-22 18:05  reborn枪  阅读(96)  评论(0)    收藏  举报