2014-05-21 2 views
1

나는 돌기가 /usr/local/bin입니다. 실행중인 which drush/usr/local/bin/drush을 반환합니다. 그러나 drush을 실행하면 "-bash: /usr/bin/drush: No such file or directory"이 표시됩니다. 실행중인 /usr/local/bin/drush 올바르게 작동합니다.쉘이 올바른 경로를 선택하지 않음.

내 $의 PATH가 [편집에 추가] /usr/local/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin

이다 나는 /usr/bin/drush을했다 스크립트의 사본을 제거이 문제를 가지고 있었다 전에. 그것은 정확하게 만들어지지 않았습니다.

이 문제의 원인은 무엇입니까? 매번 /usr/local/bin/drush을 타이핑하고 싶지는 않습니다. 그래서 /usr/local/bin은 내 $PATH에 있습니다.

답변

3

이전에 drush을 실행 한 다음 /usr/bin에서 /usr/local/bin으로 이동 했습니까? 그렇다면 hash 명령은 쉘이 /usr/bin 위치에있는 명령을 기억했다는 것을 보여줄 것이고 재확인하지 않고 쉘에 있다고 가정 할 것입니다. 실행 hash -r이 목록을 지 웁니다. 해시는 나에게 목록을 보여줍니다 -d``나는 이것이 내 문제가있을 수 있습니다 생각

$ echo >/usr/bin/hello 'echo hello' 
$ chmod +x /usr/bin/hello 
$ hash 
hits command 
    1 /bin/chmod 
$ hello 
hello 
$ hash 
hits command 
    1 /bin/chmod 
    1 /usr/bin/hello 
$ which hello 
/usr/bin/hello 
$ mv /usr/bin/hello /usr/local/bin/ 
$ hello 
bash: /usr/bin/hello: No such file or directory 
$ hash 
hits command 
    1 /usr/bin/which 
    1 /bin/chmod 
    1 /bin/mv 
    2 /usr/bin/hello 
$ which hello 
/usr/local/bin/hello 
$ hash -r 
$ hash 
hash: hash table empty 
$ hello 
hello 
$ hash 
hits command 
    1 /usr/local/bin/hello 
+0

:하지만,

예를했다. 아무것도 정리하지 않는 것 같습니다. – meustrus

+0

미안하지만,'hash -r'을 의미했습니다. –

+0

Excellent! 그 문제에 대한 또 다른 터미널을 열어 놓았습니다. 내가 가지고 있었던 문제로 완전히 난처하지 않으면 빨리 끝났을 것입니다. – meustrus

관련 문제