2016년 5월 8일 일요일

[shellscript] source 명령어 (source ~/.bash_profile)

  • 문제: bash_profile에 설정사항들이 바로 터미널에 반영되지 않는다
  • 이유: 같은 세션내에서는 아직 새로 만든 bash_profile 파일이 적용되지 않았기 때문
  • 해결방법: source ~/.bash_profile
  • source명령어의 역할?
    • 그 해당위치의 파일을 지금 다시 읽어서 재실행 
    • 현재 다시 파일을 다시 load하는 기능
      • [source command] 에 대한 원문
      • The source command can be used to load any functions file into the current shell script or a command prompt.
      • It read and execute commands from given FILENAME and return.
      • The pathnames in $PATH are used to find the directory containing FILENAME. If any ARGUMENTS are supplied, they become the positional parameters when FILENAME is executed.
        • reference : https://bash.cyberciti.biz/guide/Source_command

댓글 없음:

댓글 쓰기