2020
10-16
10-16
shell字符串截取报错:Bad substitution的解决
问题重现:当前系统Ubuntu16shell进行字符串截取运行${GIT_COMMIT:0:6}报错:/tmp/jenkins7505855461406722507.sh:4:/tmp/jenkins7505855461406722507.sh:Badsubstitution原因:两种shell语言解释器bash和dash查看当前/bin/sh指向哪种解释器:ls/bin/sh-allrwxrwxrwx1rootroot4Mar262018/bin/sh->dash修改bin/sh指向为bash:sudoln-fs/bin/bash/bin/sh或者运行sudodpkg-reconfiguredash后选择NO或者修...
继续阅读 >