
livy-server
명령줄에서 직접 작동하는 시작 명령이 있습니다 .
$cd /git/livy; nohup bin/livy-server > /tmp/livy.log 2>&1 &
[1] 4370
19:11:11/livy $
19:11:12/livy $ll /tmp/livy.log
-rw-r--r-- 1 boes wheel 436 Jan 26 19:11 /tmp/livy.log
하지만 그렇습니다~ 아니다함수에서. 내에는 ~/.profile
시작하는 기능이 있습니다 livy-server
.
startlivy() { cd /git/livy; nohup bin/livy-server > /tmp/livy.log 2>&1 & ; }
/Users/boescst/.profile: line 432: syntax error near unexpected token `;'
-bash: /Users/boes/.profile: line 432: `startlivy() { cd /git/livy; nohup bin/livy-server > /tmp/livy.log 2>&1 & ; }'
&
앰퍼샌드를 어떻게든 이스케이프해야 합니까 ?
그런데 이것이 결과에 영향을 미치지 않을 수도 있지만 저는 그렇습니다 El Capitan
.
답변1
문제는 제거해야 할 마지막 세미콜론입니다.
startlivy() { cd /git/livy; nohup bin/livy-server > /tmp/livy.log 2>&1 & }
답변2
이 문제는 단일 라이너를 사용하려고 할 때만 발생하는 것으로 보입니다. 즉, 다음과 같습니다.하다일하다:
startlivy() {
cd /git/livy
nohup bin/livy-server > /tmp/livy.log 2>&1 &
}
참고: 이것을 한 줄로 처리하는 방법을 아는 사람이 있다면 알고 싶습니다. 상을 드리겠습니다.