2014-10-28 2 views
0

여기명령을 실행하지 등/rc.local에 우분투

#!/bin/sh -e 
# 
# rc.local 
# 
# This script is executed at the end of each multiuser runlevel. 
# Make sure that the script will "exit 0" on success or any other 
# value on error. 
# 
# In order to enable or disable this script just change the execution 
# bits. 
# 
# By default this script does nothing. 
cd ~/xcape && ./xcape -e 'Control_L=Escape' 
exit 0 

우분투에서 나는 xcape 디렉토리 안에 ./xcape -e 'Control_L = 탈출'을 실행해야 내 전체를 rc.local 파일입니다 내 모자를 스스로 눌러서 Esc 키로 작동하도록 설정하고 누르고 있으면 제어 할 수 있습니다.

내 컴퓨터를 시작할 때마다이 명령을 실행해야하는데, 이는 성가신 일입니다. 그래서 시작할 때이 명령을 자동으로 실행하고 소스가 출구 0 이상에서 명령을 실행한다고 읽습니다. 절대 경로가있다. 컴퓨터를 끄고 켰을 때 작동하지 않고 캡 잠금 키가 컨트롤 역할을하지만 탈출하지 않아야합니다. 그래서 내 명령이 실행되지 않는다는 결론에 도달했습니다. 나는 어떻게해야합니까?

+0

이 질문은 Askubuntu, Unix 및 Linux 또는 수퍼 유저가 Stackoverflow보다 더 많은 주제가 될 것이라고 제안합니다. – unixsmurf

답변

1

조금 낡았지만이 확장되지 않으므로 명령에 대한 전체 경로를 추가하십시오. 따라서 ./은 작동하지 않습니다.

#!/bin/sh -e 
# 
# rc.local 
# 
# This script is executed at the end of each multiuser runlevel. 
# Make sure that the script will "exit 0" on success or any other 
# value on error. 
# 
# In order to enable or disable this script just change the execution 
# bits. 
# 
# By default this script does nothing. 
/home/<USER>/xcape -e 'Control_L=Escape' 
exit 0 

같은 일이 < 사용자 > 사용자 이름 어디. /etc/rc.local이 실행 가능하다는 것을 확인하십시오. chmod +x /etc/rc.local

관련 문제