shell
Posted bailuoxi
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了shell相关的知识,希望对你有一定的参考价值。
1、获取绝对路径以及命令是否成功
SHELL_FOLDER=$(cd "$(dirname "$0")";pwd)
2、或命令分析
command1 || command2
如果||左边的命令(命令1)未执行成功,那么就执行||右边的命令(命令2)
3、docker images过滤指定的镜像
docker images --no-trunc --filter=reference=‘mypython:latest‘|grep ‘mypython ‘ > /dev/null 2>&1
--no-trunc:不截断输出
--filter=reference=‘mypython:latest‘ :过滤REPOSITORY和TAG
以上是关于shell的主要内容,如果未能解决你的问题,请参考以下文章