Skip to content

Instantly share code, notes, and snippets.

@ttdoda
Last active January 6, 2017 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ttdoda/eeb3431f68b4d23c349eaa5ae90b437b to your computer and use it in GitHub Desktop.
Save ttdoda/eeb3431f68b4d23c349eaa5ae90b437b to your computer and use it in GitHub Desktop.
PATHに : を含められるか。zshの場合
sue@mizup% echo $PATH
/bin:/usr/bin
sue@mizup% echo $path
/bin /usr/bin
sue@mizup% cat /home/sue/path:test/path-test
#!/bin/sh
echo $0 test
sue@mizup% path-test
zsh: command not found: path-test
sue@mizup% path=($path /home/sue/path:test)
sue@mizup% echo $path
/bin /usr/bin /home/sue/path:test
sue@mizup% echo $PATH
/bin:/usr/bin:/home/sue/path:test
sue@mizup% path-test
/home/sue/path:test/path-test test
sue@mizup% csh
sue@mizup:~ % echo $path
/bin /usr/bin /home/sue/path test
sue@mizup:~ % echo $PATH
/bin:/usr/bin:/home/sue/path:test
sue@mizup:~ % path-test
path-test: コマンドが見つかりません.
sue@mizup:~ % set path=($path /home/sue/path:test)
sue@mizup:~ % echo $path
/bin /usr/bin /home/sue/path test /home/sue/path:test
sue@mizup:~ % echo $PATH
/bin:/usr/bin:/home/sue/path:test:/home/sue/path:test
sue@mizup:~ % path-test
/home/sue/path:test/path-test test
sue@mizup:~ % exit
exit
sue@mizup% PATH="${PATH}:/usr/local/bin"
sue@mizup% echo $PATH
/bin:/usr/bin:/home/sue/path:test:/usr/local/bin
sue@mizup% echo $path
/bin /usr/bin /home/sue/path test /usr/local/bin
sue@mizup% path-test
zsh: command not found: path-test
sue@mizup%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment