5.shell给变量设置默认值

如下

#!/usr/bin/env bash
echo ${DEBUG-123}

如果DEBUG变量不存在,则输出默认值为123

原文地址:https://www.cnblogs.com/robinunix/p/13265581.html