1. 首页
  2. Linux
  3. 运维

${variable:-10}` 和 `${variable: -10}` 有什么区别?



${variable:-10}` - 如果之前没有给 variable 赋值则输出 10;如果有赋值则输出该变量
${variable: -10} - 输出 variable 的最后 10 个字符

发布者:admin,如若转载,请注明出处:https://ai1024.vip/41172.html

QR code
//