LoginSignup
2
0

More than 5 years have passed since last update.

【小ネタ】echo $PATHとするとPATHが見れるが、小文字でecho $pathとすると。。。

Last updated at Posted at 2018-11-12

PATHの区切りのコロンがスペースになって見やすい?というかなにこれ

➜  ~ echo $PATH
/Users/hidehiro/.nodebrew/current/bin:./bin:./node_modules/.bin:/Users/hidehiro/.pyenv/shims:/Users/hidehiro/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
➜  ~ echo $path
/Users/hidehiro/.nodebrew/current/bin ./bin ./node_modules/.bin /Users/hidehiro/.pyenv/shims /Users/hidehiro/.rbenv/shims /usr/local/bin /usr/bin /bin /usr/sbin /sbin /usr/local/sbin
➜  ~ 

追記

友人の @Cool0707 から教えてもらいました。
PATHは環境変数で、pathは環境変数と同期しているシェル変数。zshではpathは配列となっていて、配列の表示が要素間にスペースを入れるものなのでこう表示されている。

https://qiita.com/uasi/items/c4288dd835a65eb9d709
https://qiita.com/mollifier/items/f897b3fddd2d10369333

2
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
2
0