Position variable.
$ $ Gets the file name of the currently executing shell script.
[Email protected] ~]# vim 0.sh
[email protected] ~]# cat 0.sh
Echo
[[Email protected] ~]# sh 0.sh
0.sh
[Email protected] ~]#
- If I put it in the full path, it will.
[email protected] ~]# sh/root/0.sh
/root/0.sh
$ A to-$ is the corresponding first variable, such as $ $ is the corresponding value of the initial variable, if it is $10, you want to use {} brackets, such as ${10}
[[email protected] ~]# sh 0.sh zhouyu
Zhouyu
By the way, SEQ is sending from which value to which value, such as command
Seq-s "" 1 10
Is that sending 1 to 10 is separated by a space,
[email protected] ~]# seq-s "$" 1
1 $ $4 $ $6 $7 $8 $9 $
$ #是指命令行参数的总个数. If you give the command line argument there are 10 then $ #就是10
DirName $ is to take the directory out of the script.
BaseName is taking out the name.
[email protected] ~]# cat 0.sh
dirname
basename
[email protected] ~]# sh/root/0.sh
/root
0.sh
[email protected] ~]#
You can take a look at the usage of the/etc/init.d/nfs file for these parameters.
This article is from "Love Zhou Yu" blog, please be sure to keep this source http://izhouyu.blog.51cto.com/10318932/1886164
shell-Special variables