命令未在etc/rc.local ubuntu中运行

命令未在etc/rc.local ubuntu中运行,ubuntu,keyboard,startup,boot,rc,Ubuntu,Keyboard,Startup,Boot,Rc,这是我的整个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 chang

这是我的整个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
在Ubuntu中,我需要在xcape目录中运行./xcape-e'Control\u L=Escape',以便使我的caps lock在按下时作为esc键工作,并在按下时进行控制


每次启动计算机时,我都需要运行这个命令,这很烦人,因此我通读了一些东西,以便在启动时自动运行这个命令,消息来源说,执行的命令高于当前的出口0,并且具有绝对路径。当我关闭电脑并打开它时,它不工作,我的caps lock键起控制作用,但不能像它应该的那样逃脱。这就是为什么我得出结论,我的命令没有运行。我该怎么办?

有点过时了,但为了以防万一,请尝试添加命令的完整路径,因为
~
不会展开,因此
/
不会工作。差不多

#!/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
#/bin/sh-e
#
#本地
#
#此脚本在每个多用户运行级别结束时执行。
#确保脚本在成功或任何其他情况下“退出0”
#错误时的值。
#
#要启用或禁用此脚本,只需更改执行
#点点滴滴。
# 
#默认情况下,此脚本不执行任何操作。
/home//xcape-e“控制=逃生”
出口0
你的用户名在哪里。
还要检查/etc/rc.local是否可执行
chmod+x/etc/rc.local

我建议这个问题更多地是关于Askubuntu、Unix和Linux或超级用户的,而不是关于Stackoverflow的。