看书的时候看到一个命令,不是很懂,mkdir test & $_ 这个$_是什么意思的,请问
看书的时候看到一个命令,不是很懂,mkdir test & $_ 这个$_是什么意思的,请问
|
jasonyang9Aug 7, 2019
1
* $_ most recent parameter (or the abs path of the command to start the current shell immediately after startup).
``` [root@localhost ~]# echo "This is a test" This is a test [root@localhost ~]# echo $_ This is a test [root@localhost ~]# ``` |
|
jasonyang9Aug 7, 2019
2
现学的。。。
|
|
3
@jasonyang9 这个命令在这里意义不明,我理解的是$_是个变量,里面是上一条命令的倒数第一个参数,echo 可以看到,但是在我看到的这个命令来好像不对啊
|
|
4
$0
当前脚本名称 $# 传递给脚本或函数的参数个数 $* 传递给脚本或函数的所有参数。 $? 上个命令的退出状态,或函数的返回值。 $$ 当前 Shell 进程 ID。对于 Shell 脚本,就是这些脚本所在的进程 ID。 $_ 保存之前执行的命令最后一个参数 |
|
hhhsuanAug 7, 2019
6
仅这一句是无意义的
|
|
8
@davidxj mkdir test && cd $_
|
|
9
@ShadowStar 谢谢
|