![Vagrant ssh는 -t 옵션을 실행한 후 연결을 닫습니다.](https://linux55.com/image/7701/Vagrant%20ssh%EB%8A%94%20-t%20%EC%98%B5%EC%85%98%EC%9D%84%20%EC%8B%A4%ED%96%89%ED%95%9C%20%ED%9B%84%20%EC%97%B0%EA%B2%B0%EC%9D%84%20%EB%8B%AB%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
내 vagrant VM(OSX에서 호스팅되는 Ubuntu 상자)을 시작하는 스크립트를 생성하려고 하며 올바른 디렉터리로 이동하여 가상 환경을 시작합니다. 나는 이 명령이 나에게 효과적이라는 것을 읽었습니다.
vagrant ssh -- -t 'some commands'
명령이 올바르게 실행되고 출력이 표시되지만 스크립트나 명령문 실행이 완료되면 연결이 닫힙니다. 이것은 내가 실행하려는 정확한 진술입니다.
vagrant ssh -- -t 'source ~/env/bin/activate; cd /vagrant/refunite-web-touchpoint; pwd'
나는 다음과 같은 결과를 얻습니다.
/vagrant/refunite-web-touchpoint
Connection to 127.0.0.1 closed.
현재 스크립트는 다음과 같습니다.
#!/bin/bash
vagrant up
vagrant ssh -- -t 'source ~/env/bin/activate; cd /vagrant/refunite-web-touchpoint; pwd'