"-bash: QSTK/local.sh:没有这样的文件或目录“
我已经犯这个错误一年多了。知道我该怎么修理它吗?在这样的问题上,没有类似的建议能解决这个问题。
回应Olivier的建议:
当我跑的时候
grep QSTK/local\.sh' /etc/* ~/.??*我得到了这个输出:
grep: /etc/aliases.db: Permission denied
grep: /etc/kcpassword: Permission denied
grep: /etc/krb5.keytab: Permission denied
grep: /etc/master.passwd: Permission denied
grep: /etc/sudoers: Permission denied
/Users/DylanRichards/.bash_profile:source QSTK/local.sh
/Users/DylanRichards/.bash_profile.pysave:source QSTK/local.sh
/Users/DylanRichards/.profile:source QSTK/local.sh
Dylan-Richardss-MacBook-Pro:~ DylanRichards$ 当我打字时
-type f -size -200 -print0 2>/dev/null | xargs -0 grep 'QSTK/local\.sh' /dev/null它什么也不回。错误仍然发生在我的终端开始的时候。
发布于 2013-11-18 10:02:42
以下是你对我问题的回答:
要查找负责的脚本,首先在shell的启动脚本中:
grep 'QSTK/local\.sh' /etc/* ~/.??*如果这还不够:
find / -type f -size -200 -print0 2>/dev/null | xargs -0 grep 'QSTK/local\.sh' /dev/null(只需复制/粘贴此文件,同时将其作为根用户登录到终端窗口中,以便您可以在大多数文件中实现grep )
(附加的"/dev/null“将强制grep显示匹配文件的名称,即使只有一个参数,如果xargs以使最后一个文件单独分裂的方式分裂,也会发生这种情况)
(我只检查小于100 of的100 x 512字节的文件,因为更大的文件很可能是二进制文件,而不是脚本.)
请注意,如果"QSTK“在一个变量中,或者是构造了.
但这是可行的。试一试,让我们知道是否足够你纠正错误,或提供额外的信息,如果你不知道如何进行。
===更新=====================
在你贴完之后:
/Users/DylanRichards/.bash_profile:source QSTK/local.sh
/Users/DylanRichards/.bash_profile.pysave:source QSTK/local.sh
/Users/DylanRichards/.profile:source QSTK/local.sh我会推荐你
/Users/DylanRichards/QSTK/local.sh文件。
ls -l /Users/DylanRichards/QSTK/local.shmore /Users/DylanRichards/QSTK/local.shchmod +x /Users/DylanRichards/QSTK/local.sh ls -al /Users/DylanRichards/QSTK/local.sh你可以,如果你想的话,发布ls -l /Users/DylanRichards/QSTK/local.sh的信息
但是,关于它的内容,请核实它(如果它可以包含重要的安全信息,就不要在这里发布.)。(如果您觉得向我们展示它是安全的,您可以发布:cat /Users/DylanRichards/QSTK/local.sh (除非它超过20行.)
最后,如果您在/Users/DylanRichards/QSTK/local.sh中找不到该文件:
find / -type f -name "local.sh" -print 2>/dev/null | grep QSTK/local.sh会告诉你它在哪里。再次检查它的内容,如果看起来很好(和需要),用正确的路径编辑~/..bash_profile和~/.profile。
发布于 2013-12-14 09:27:23
使用文本编辑器打开.bashrc文件如下所示
$gedit .bashrc
在文本文件中,查找路径.QSTK/local.sh,可能在最后一行中,您可能类似于VIRTUAL_ENV_DISABLE_PROMPT=1源代码/home/QSTK/local.sh
注释掉行,在行的开头添加一个#,然后保存
试试看
https://stackoverflow.com/questions/20043012
复制相似问题