文件;;中这段代码的含义是什么~/bashrc?
case $- in
*i*) ;;
*) return;;
esac
Run Code Online (Sandbox Code Playgroud)
我可以;;通过其他方式使用吗?在哪里?
来自man bash:
If the ;; operator is used, no subsequent matches are
attempted after the first pattern match. Using ;& in place of
;; causes execution to continue with the list associated with
the next set of patterns. Using ;;& in place of ;; causes the
shell to test the next pattern list in the statement, if any,
and execute any associated list on a successful match.
Run Code Online (Sandbox Code Playgroud)
所以不,你不能使用“;;” 在其他地方,它是 bash 脚本中特定于案例的语法。至于含义,如果你用;;完成每个case项,它会在执行第一次匹配的代码后停止。如果您使用 ;& 代替,它将执行第一个匹配项,然后继续查找其他匹配项,因此您可以执行多个匹配操作。
有关其他信息,请参阅
和
http://www.tldp.org/LDP/Bash-Beginners-Guide/html/