英文:
How to fix the terminal "source" command on OSX Catalina
问题
$ source ~/.bash_profile
或 . ~/.bash_profile
系统返回:
-bash: [[-s: command not found
英文:
I try executing the below commands in my terminal.
$ source ~/.bash_profile
or . ~/.bash_profile
and the system returns:
-bash: [[-s: command not found
I cannot think of anything extra information to provide.
答案1
得分: 1
I kept researching my issue and came across this stackoverflow post
I initially misunderstood the error message to mean the source command was not found. After reading the other post I tried running bash .bash_profile
and the result was .bash_profile: line 11: [[-s: command not found
. I had an error in my .bash_profile file. I commented out the line and tried running source .bash_profile
and it worked.
The initial command not found did not relate to the source command, it related to the file I was running with source.
I hope this helps someone else.
英文:
I kept researching my issue and came across this stackoverflow post
I initially misunderstood the error message to mean the source command was not found. After reading the other post I tried running bash .bash_profile
and the result was .bash_profile: line 11: [[-s: command not found
. I had an error in my .bash_profile file. I commented out the line and tried running source .bash_profile
and it worked.
The initial command not found did not relate to the source command, it related to the file I was running with source.
I hope this helps someone else.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论