문서 내용:
PS1="$(hostname):${LOGNAME}:\${PWD} ${PROMPT} "
PS1="${FGOLD}$(hostname):${LOGNAME}:\${PWD} ${PROMPT} ${NORMAL}"
PS1=abd
PS1="$(hostname):$LOGNAME:\$PWD $PROMPT "
export PS1 LANG
바꾸고 싶은 라인:
PS1="$(hostname):${LOGNAME}:\${PWD} ${PROMPT} "
교체 라인:
PS1="${FGOLD}$(hostname):${LOGNAME}:\${PWD} ${PROMPT} ${NORMAL}"
답변1
당신이 사용할 수있는 sed
:
sed 's/^PS1="\$(hostname).*\${PROMPT}.*/PS1="${FGOLD}$(hostname):${LOGNAME}:\\\${PWD} ${PROMPT} ${NORMAL}"/'