Bash检查字符串是否包含子字符串列表之一

时间:2019-11-02 13:16:06

标签: string bash

在git commit-msg钩中,如何检查消息是否包含子字符串列表之一?

commit_msg="$1"

# if commit_msg includes one of ["upgrade deps", "upgrade dependencies", "update deps", "update dependencies"]
# do stuff

0 个答案:

没有答案