Linux bash:打印:找不到命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3891887/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
bash: print: command not found
提问by jasonline
I've just added a .profile to my bash shell. However, I've noticed the error "-bash: print: commant not found" keeps on appearing even if you are changing to a valid directory. My .profile just contains a few exports.
我刚刚在我的 bash shell 中添加了一个 .profile。但是,我注意到错误“-bash:打印:未找到命令”即使您正在更改为有效目录也会不断出现。我的 .profile 只包含一些导出。
[rob@mypc:/home/rob]cd apps
-bash: print: command not found
[rob@mypc:/home/rob/apps]cd util
-bash: print: command not found
[rob@mypc:/home/rob/apps/util]
Can anyone point out why this error keeps on showing?
谁能指出为什么这个错误一直显示?
采纳答案by Burton Samograd
Check the output of:
检查输出:
echo $PROMPT_COMMAND
it might give some clues, or else you might have cd aliased to something, so check the output of:
它可能会提供一些线索,否则您可能将 cd 别名为某些东西,因此请检查以下输出:
alias
回答by ghostdog74
use printf
or echo
使用printf
或echo
回答by jonescb
Look in your .bash_profile and .bashrc and see if anything is using the print command.
查看您的 .bash_profile 和 .bashrc 并查看是否有任何内容正在使用打印命令。
回答by Ruel
Change the occurence of print
in ~/.profile
, ~/.bash_profile
, or /etc/profile
(system wide) to echo
.
将print
in ~/.profile
、~/.bash_profile
、 或/etc/profile
(系统范围内)的出现更改为echo
。