In Bash, I want to rename a file so that the prefix up to - is removed, but why does it not work with brace expansion?$ lsThomas Anderson, Michael Dahlin-Operating Systems$ mv {Thomas\ Anderson,\ Michael\ Dahlin-,}Operating\ Systemsmv: target Operating Systems is not a directory
Brace expansion does not work
bash
Your file contain , which is special to brace expansion, so your brace expansion expanded to 3 strings, instead of two as you intend.You can try:$ printf '%s\n' {Thomas\ Anderson,\ Michael\ Dahlin-,}Operating\ SystemsThomas AndersonOperating Systems Michael Dahlin-Operating SystemsOperating Systemsto see how brace expansion was expanded.The quick fix is escaping the ,:$ printf '%s\n' {Thomas\ Anderson\,\ Michael\ Dahlin-,}Operating\ SystemsThomas Anderson, Michael Dahlin-Operating SystemsOperating Systems