shell 默认参数

#!/bin/bash

dst_dir=${2:-/tmp}  # 当 $2 为空或null时,设置默认值。
docker cp prometheus:$1 $dst_dir
posted @ 2022-03-15 09:56  武平宁  阅读(165)  评论(0)    收藏  举报