Skip to content

PS1 중복 코드 제거#101

Open
tmfdk333 wants to merge 1 commit intomasterfrom
script
Open

PS1 중복 코드 제거#101
tmfdk333 wants to merge 1 commit intomasterfrom
script

Conversation

@tmfdk333
Copy link
Collaborator

  • DEV- 로 표시되는 부분에 color code가 중복되어 제거
  • pwd 명령어 대신 escape sequence를 사용하여 home directory는 ~로 표시되도록 변경

@tmfdk333 tmfdk333 requested a review from occidere May 22, 2019 03:51

BASHRC='/etc/bashrc'
echo 'export PS1="\[\e[1;34m\]DEV\[\e[m\]\[\e[1;34m\]-\[\e[m\][\h:\$(pwd)] " ' >> ${BASHRC}
echo 'export PS1="\[\e[1;34m\]DEV-\[\e[m\][\h:\w] " ' >> ${BASHRC}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR 감사합니다!

우선 현재의 절대 경로를 알고 싶어서 ~ 표기 대신 절대경로를 표시하도록 하였습니다.
또한 DEV 와 그 뒤의 - 도 색상을 적용하고자 해서 \[\e[1;34m\]를 2번 사용했습니다.

다만 DEV 바로 뒤의 \[\e[\m\] 은 중복이 맞는 것 같습니다.

최종적으로 아래와 같이 바꿔주시면 좋을 것 같아요~

echo 'export PS1="\[\e[1;34m\]DEV\[\e[1;34m\]-\[\e[m\][\h:\$(pwd)] " ' >> ${BASHRC}

감사합니다 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants