gpt4 book ai didi

shell - Unix shell 中的特殊变量?

转载 作者:行者123 更新时间:2023-12-02 00:11:54 25 4
gpt4 key购买 nike

我需要关于 Unix shell 特殊变量(csh、ksh 和 bash)的良好引用。

例如$1 , $* , $#

最佳答案

这里:http://sillydog.org/unix/scrpt/scrpt2.2.2.php

$1 - $9 these variables are the positional parameters.

$0 the name of the command currently being executed.

$# the number of positional arguments given to this invocation of the shell.

$? the exit status of the last command executed is given as a decimal string. When a command completes successfully, it returns the exit status of 0 (zero), otherwise it returns a non-zero exit status.

$$ the process number of this shell - useful for including in filenames, to make them unique.

$! the process id of the last command run in the background.

$- the current options supplied to this invocation of the shell.

$* a string containing all the arguments to the shell, starting at $1.

$@ same as above, except when quoted.

更多资源:

关于shell - Unix shell 中的特殊变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3206312/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com