我为什么在使用sed命令时会出现zsh事件未找到的错误?

huangapple go评论62阅读模式
英文:

Why i am getting error zsh event not found on sed command

问题

以下是已翻译的内容:

sed "s/map(\x27t\x27, \x27<Esc>\x27, \x27<C-\\\\><C-n>\x27)/map(\x27t\x27, \x27<Esc>\x27, \x27<C-\\\\><C-n>:q!<cr>\x27)/g" ~/.config/nvim/lua/core/keymaps.lua

zsh: 事件未找到: <cr>\x27)/g

你能指导我吗?我犯了什么错误?

我想将这个

map('t', '<Esc>', '<C-\\><C-n>')

更改为

map('t', '<Esc>', '<C-\\><C-n>':q!<cr>)

使用 Sed

谢谢
英文:
sed "s/map(\x27t\x27, \x27<Esc>\x27, \x27<C-\\\\><C-n>\x27)/map(\x27t\x27, \x27<Esc>\x27, \x27<C-\\\\><C-n>:q!<cr>\x27)/g" ~/.config/nvim/lua/core/keymaps.lua

zsh: event not found: <cr>\x27)/g

Can you please guide me. What’s the mistake, I am making?

I want to change this

map('t', '<Esc>', '<C-\\><C-n>')

Into

map('t', '<Esc>', '<C-\\><C-n>':q!<cr>)

Using Sed

Thanks

答案1

得分: 1

! 在 ZSH shell 中是历史扩展。请查看 https://zsh.sourceforge.io/Doc/Release/Expansion.html 。你出现错误是因为你从未有一个以 \x27/g 开头的命令。

英文:

! is a history expansion in ZSH shell. See https://zsh.sourceforge.io/Doc/Release/Expansion.html . You are getting the error, because you never had a command that started with \x27/g.

huangapple
  • 本文由 发表于 2023年2月27日 06:24:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/75575374.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定