首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在etc/rc.local ubuntu中未运行命令

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

Stack Overflow用户
提问于 2014-10-29 07:39:23
回答 1查看 590关注 0票数 0

下面是我的整个rc.local文件

代码语言:javascript
复制
#!/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_L=Escape‘,这样才能让我的大写锁定在按下时像esc键一样工作,并在按下时进行控制。

我每次启动计算机时都需要运行此命令,这很烦人,所以我通读了在启动时自动运行此命令的内容,以及在0号出口上执行命令的来源,并具有绝对路径。当我关闭电脑并打开它时,它不工作,我的caps lock键起到了控制作用,但并没有像它应该的那样逃脱。这就是为什么我要得出结论,我的命令没有运行。我该怎么办?

EN

回答 1

Stack Overflow用户

发布于 2015-05-06 01:28:07

有点过时了,但以防万一,请尝试在命令中添加完整路径,因为~不会扩展,因此./将不起作用。就像这样

代码语言:javascript
复制
#!/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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26620396

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档