0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

「zsh: command not found: $」←こいつを倒す

Last updated at Posted at 2024-06-28
$ echo 'Hello'

こういうコードサンプルを適当にコピペしてzshに貼って

$ $ echo 'Hello'
zsh: command not found: $

こう怒られたことのある人は多いのではないか。

それくらい察して無視してくれよと思わなくもないが、自分のコピペミスが悪いのでしかたがない。でもそれなりにイラッとくる。

回避策はある。
$ を何もしないエイリアスとして登録してしまえばいいのだ:

.zshrc
alias '$'=''

こうして

$ $ echo 'Hello'
Hello

こうじゃ!

bashだと $ が特殊文字扱いでNGっぽいので、だれか方法知ってたら教えてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?