기본 콘텐츠로 건너뛰기

글

라벨이 smartcd인 게시물 표시

perl smartcd

perl을 사용해 개발을 할 때 이런저런 이유로 PATH 환경변수를 변경 해야할 때가 많다... 매번 eval 할 필요 없이 디렉토리 이동할 때 마다 자동으로 bash로 변경할 수 있게 하는것이 smartcd.  https://github.com/cxreg/smartcd 원하는곳에 클론을 받는다.  $ git clone  https://github.com/cxreg/smartcd 설치를 한다. $ make install $ source load_smartcd $ smartcd config 설치가 완료되면 입력할 폴더로 이동한다. $ mkdir ~/test  $ cd ~/test  smartcd 를 사용한다. $ echo 'eval $(perl -Mlocal::lib=~/test | sed '\''s/export/autostash/'\'')' | smartcd edit enter 확인을 한다.  $ cd .. $ cd ~/test 커멘드에 표시가 된다.  smartcd: running /home/lars/.smartcd/scripts/home/user/test/bash_enter 궁금하니까 한번 더 확인해 본다.  $ echo $PATH  /home/user/test/bin :/usr/local/sbin :/usr/local/bin :/usr/sbin :/usr/bin :/sbin :/bin :/usr/games :/usr/local/games  잘 추가가 되었다. 끝.