[英]bash: print: command not found
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.我刚刚将 a.profile 添加到我的 bash shell。但是,我注意到错误“-bash: print: commant not found”一直出现,即使您正在更改到有效目录。 My.profile just contains a few exports.
My.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?谁能指出为什么这个错误不断出现?
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
使用printf
或echo
查看.bash_profile和.bashrc,看看是否有任何东西正在使用print命令。
将~/.profile
, ~/.bash_profile
或/etc/profile
(系统范围)中的print
出现更改为echo
。
Substitute print
with printf
.用
printf
代替print
。 At least in my case, I had the following in .bash_profile
至少就我而言,我在
.bash_profile
中有以下内容
function tabname {
print "\e]1;$1\a"
}
to change the name of a Terminal tab.更改终端选项卡的名称。 When I tried changing
print
to echo
, it just echoed the text exactly, ie, \e]1;new tab name\a
, but when I used printf
, then it worked as expected.当我尝试将
print
更改为echo
时,它只是准确地回显了文本,即\e]1;new tab name\a
,但是当我使用printf
时,它按预期工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.