如何修复在OSX Catalina上的终端“source”命令

huangapple go评论101阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年1月6日 22:23:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/59613756.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定