文書の内容:
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}"/'