2014-10-09 1 views
2

:의 bash : ~/.bash_profile에 :이 오류가 계속 그런 파일이나 디렉토리

alias ngrok=/Users/mmahalwy/Desktop/Code/ngrok 

export CLICOLOR=1 
export LSCOLORS=GxFxCxDxBxegedabagaced 

alias ls='ls -GFh' 

function prompt { 
  local BLACK="\[\033[0;30m\]" 
  local BLACKBOLD="\[\033[1;30m\]" 
  local RED="\[\033[0;31m\]" 
  local REDBOLD="\[\033[1;31m\]" 
  local GREEN="\[\033[0;32m\]" 
  local GREENBOLD="\[\033[1;32m\]" 
  local YELLOW="\[\033[0;33m\]" 
  local YELLOWBOLD="\[\033[1;33m\]" 
  local BLUE="\[\033[0;34m\]" 
  local BLUEBOLD="\[\033[1;34m\]" 
  local PURPLE="\[\033[0;35m\]" 
  local PURPLEBOLD="\[\033[1;35m\]" 
  local CYAN="\[\033[0;36m\]" 
  local CYANBOLD="\[\033[1;36m\]" 
  local WHITE="\[\033[0;37m\]" 
  local WHITEBOLD="\[\033[1;37m\]" 
  local RESETCOLOR="\[\e[00m\]" 

  export PS1="\n$RED\u [email protected] $GREEN\w $BLUE[\#] → $RESETCOLOR" 
  export PS2="| → $RESETCOLOR" 
} 

# prompt 

export PATH=/usr/local/bin:$PATH 

source ~/.git-completion.bash 

if [ -f `brew --prefix`/etc/bash_completion ]; then 
    . `brew --prefix`/etc/bash_completion 
fi 


source ~/.profile 
source /Users/mmahalwy/.iterm2_shell_integration.bash 

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* 

UPDATE

문제가 있었다 : 여기

bash: ~/.bash_profile: No such file or directory 

내 bash_profile 없다 실수로 vim에서 복사 한 후행 "~/.bash_profile" 38L, 1070C. 도와 주셔서 감사합니다!

+0

'PS4 = '설정 : $ BASH_SOURCE : $ LINENO +'; set -x'를 입력하면 줄 번호가 인쇄되고 재생됩니다. –

+0

이 말하길, 어딘가에, 당신은 확장을 위해 따옴표를 써야 할 필요가있는'~'을 인용하고 있습니다. (이런 이유로 나는 스크립트에서'~'보다'$ HOME'을 선호합니다.) –

+0

어쨌든 - 문제가이 특정 파일에 없지만'.bash_profile'을 호출하려고했지만'~'을 인용하면 뭔가 놀랍지 않을 것입니다. 따라서 그렇게 잘못되었습니다. –

답변

3

배쉬는 ~/.profile~/.profile 대신

~/.bash_profile의 내용이 있습니다

# ~/.profile: executed by the command interpreter for login shells. 
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login 
# exists. 
# see /usr/share/doc/bash/examples/startup-files for examples. 
# the files are located in the bash-doc package. 

# the default umask is set in /etc/profile; for setting the umask 
# for ssh logins, install and configure the libpam-umask package. 
#umask 022 

# if running bash 
if [ -n "$BASH_VERSION" ]; then 
    # include .bashrc if it exists 
    if [ -f "$HOME/.bashrc" ]; then 
    . "$HOME/.bashrc" 
    fi 
fi 

# set PATH so it includes user's private bin if it exists 
if [ -d "$HOME/bin" ] ; then 
    PATH="$HOME/bin:$PATH" 
fi 
+0

죄송합니다 어디에 있나요? –

+0

Bash는 첫번째 사용 가능한 것을 사용합니다.'.bash_profile'이 없다면'.profile'로 되돌아갑니다. 물론이 경우'.bash_profile'은'.profile'을 명시 적으로 제공합니다. –

+0

'root @ debian :/home/mohsen/test # ls/etc/skel/-a 입니다. .. .bash_logout .bashrc .profile' – PersianGulf

2

UPDATE를

문제였다 내가 실수로 복사 한 후행 "~/.bash_profile에"38L, 1070C vim에서. 도와 주셔서 감사합니다!

0

제 경우, 다음과 같은 오류가 발생했습니다. 이미 파일에 미리 작성된 된 두 개의 명령 아래, .bash_profile 파일을 만들 때

-bash: /Users/mac241/.rvm/scripts/rvm: No such file or directory 
-bash: /Users/mac241/.rvm/scripts/rvm: No such file or directory 

는 몇 가지 검사 후에, 나는 알고있어.

source /Users/mac241/.rvm/scripts/rvm 
source /Users/mac241/.rvm/scripts/rvm 

오류에 따라이 문제가 있다는 것을 알고 있어야하며 제거한 후에 작동하기 시작했습니다. 쉘 시작시 자동으로 실행해야하는 명령 만 작성하여 정의되기를 바랍니다.

관련 문제