简体   繁体   中英

Command substitution in zsh

I'm trying to use simple command substitution in zsh to cd to the output of another command ( which with dirname ).

  • which git/usr/bin/git as expected;
  • dirname $(which git)/usr/bin as expected;
  • cd $(dirname $(which git))cd: no such file or directory: ^[[0m^[[0m/usr/bin

What's happening here? What is ^[[0m and why is it showing up all of a sudden?

删除~/.zshrc这一行~/.zshrc它:

trap 'printf "\\e[0m" "$_"' DEBUG

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM