Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Understanding of the parameters passed by script

2025-05-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

${! #} enter the last parameter

$# number of input parameters

$* enter all parameter strings and treat all parameters as one string.

$n output n parameters

$? The exit status of the previous command, or the return value of the function.

$the current Shell process ID. For Shell scripts, it is the process ID where these scripts are located.

The difference between $* and $@

Both $* and $@ indicate that all arguments passed to a function or script, when not contained in double quotes (""), are marked with "$1"$2". Outputs all parameters in the form "$n".

But when they are enclosed in double quotes (""), "$*" takes all the parameters as a whole and outputs all parameters in the form of "$1 $2 … $n"; "$@" separates the parameters as "$1"$2"... Outputs all parameters in the form "$n".

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report