简体   繁体   中英

terminal displays source error message at start up

so recently I noticed that every time I open a new terminal window, the terminal would display this message first

-bash: source: -/: invalid option
source: usage: source filename [arguments]

I use macbook with MacOS Sierra. I don't know if this relates to the problem or not, but I recently edited ssh config file for a class.

This almost certainly means that you created a syntax error in the file you edited.

The output here is telling you that source is invoked incorrectly. It looks like you have -/ instead of a proper option (are you missing the rest of a filepath or did you forget to use quotes or otherwise deal with spaces in your filepath?).

$ source -/
bash: source: -/: invalid option
source: usage: source filename [arguments]

In any case something is mangled in your usage of source . You could run this in your home dir:

$ grep "source" ./*

To see which files are using source in your home directory (note, depending on what you've edited, the problem could be elsewhere). Notably, there are files in /etc/ / which would traditionally be using the source command.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM