LoginSignup
0
1

More than 5 years have passed since last update.

macbook でターミナル開いたときに.bash_profileのエラー吐く

Last updated at Posted at 2017-10-11

ターミナル開くと必ず、以下のエラー。
しかもぐぐっても解消法にたどり着けず、、、
このエラーになると、今利用しているユーザーが自分だと認識されず、
いろんなとこで permission denied がでる、、、
sudo 打てば問題ないんだけど、対処療法にすぎないし、、、
以下、出たエラーと修正前の.bash_profileの情報

出たエラー

last login: Wed Oct 11 00:37:16 on ttys000
-bash: /Users/ユーザー名/.bash_profile: line 2: syntax error near unexpected token `fi'
-bash: /Users/ユーザー名/.bash_profile: line 2: `fi'

修正前の.bash_profileの情報

  source '/Users/ユーザー名/Downloads/google-cloud-sdk/path.bash.inc'
  fi

  export M3_HOME=/Users/ユーザー名/Downloads/apache-maven-3.3.9
  M3=$M3_HOME/bin
  export PATH=$M3:$PATH
   source '/Users/shuya/Downloads/google-cloud-sdk/completion.bash.inc'
  fi

  # The next line updates PATH for the Google Cloud SDK.
  if [ -f /Users/ユーザー名/Downloads/google-cloud-sdk/path.bash.inc ]; then
   source '/Users/ユーザー名/Downloads/google-cloud-sdk/path.bash.inc'
  fi

  # The next line enables shell command completion for gcloud.
  if [ -f /Users/ユーザー名/Downloads/google-cloud-sdk/completion.bash.inc ]; then
   source '/Users/ユーザー名/Downloads/google-cloud-sdk/completion.bash.inc'
  fi

  export NVM_DIR="$HOME/.nvm"
  [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm

以下のように自力対処し、エラーは出なくなったが、あってるかはわからず、、、
どなたか正しい対処法ご存知でしたらコメントお願いします。

ターミナルで、
/usr/bin/open -e ~/.bash_profile

2行目、8行目の fi 削除
これで一旦エラーはでなくなった。
なんだ、、これ、、。

0
1
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1