yihong0618 和朋友们的频道 头像

消息来源频道

yihong0618 和朋友们的频道

@hyi0618

频道8,612 位成员公开可见0 人在线

yihong0618 和朋友们的频道

成员规模8,612 位成员
在线情况0 人在线
消息总数10,129 条消息
浏览量总数3,276,841 次浏览

在这个频道里搜索消息……

t.me/hyi0618

TIL:
📌 Check If The First Argument Is Given
In a shell script, you may want to check if an argument was given. Each
argument is referenced numerically with the $ prefix, so the first argument
is $1. To check if the first argument is given, you can use the -z check.
if [ -z "$1" ]
then
echo "The first argument is missing"
exit 1
fi
The -z checks if the argument is a zero-length string (so "" or undefined
will be true). If it is missing, then we echo out a message and exit the
script. This is how I might fashion a script that requires the first argument.
source