zsh:没有找到匹配的产品。tr [:space:] '\t' zsh: no matches found: [:space:] But if I do this in ...

问题描述 投票:0回答:1
sees the

and interpets it as a wildcard glob that will match a file named

,

$ echo 'Welcome To Here' | tr [:space:] '\t'
zsh: no matches found: [:space:]

,

$ echo 'Welcome To Here' | tr [:space:] '\t'
Welcome To  Here

,

,
whitespace zsh removing-whitespace oh-my-zsh tr
1个回答
2
投票

zsh with the [:space:] shell option enabled - your setup presumably turns it off somewhere. Just wrap it in quotes to prevent expansion:: s由于某些原因,在zsh中,我无法使用[:space:]模式来匹配所有的空白字符。p例如:[:空格:]模式。 a但是如果我在bash中这样做,就可以正常工作了。c这会不会是我的 ~.zshrc 有什么问题,还是 zsh 不支持这个?我也在使用 oh my zsh。e bash failglob出于某种原因,在zsh中,我无法使用[:space:]模式来匹配所有的空白字符,例如: $ echo 'Welcome To Here' (欢迎来到这里

© www.soinside.com 2019 - 2024. All rights reserved.