String replacement (to lowercase) in Bash 4.3.33 - bad substitution error -
i'm trying change uppercase lowercase using string replacement in bash, i'm getting bad substitution error.
> a=hey > echo $a hey > echo ${a,,} -bash: ${a,,}: bad substitution # desired output hey i've seen similar questions this, in cases down using earlier version of bash. i'm using gnu bash 4 , still having same problems.
> bash --version gnu bash, version 4.3.33(1)-release (x86_64-apple-darwin14.1.0) this mac thing maybe? appreciated.
looks bash first in path happens 4.3.33, bash you're running in interactive session older version. run echo "$bash_version" check.
if above correct, run
type bash to see path of newer version, /opt/local/bin/bash. i'll assume is. if want login shell, first add /etc/shells
sudo -e /etc/shells after that, users allowed select login shell using chsh (change shell) command
chsh -s /opt/local/bin/bash
Comments
Post a Comment