Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!AUREL.CALTECH.EDU!bfox From: bfox@AUREL.CALTECH.EDU (Brian Fox) Newsgroups: gnu.bash.bug Subject: Seeing control characters in aliases and functions Message-ID: <8909142124.AA25167@aurel.caltech.edu> Date: 14 Sep 89 21:24:53 GMT References: <1952@prune.bbn.com> Sender: daemon@tut.cis.ohio-state.edu Reply-To: bfox@aurel.caltech.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 45 Date: 14 Sep 89 16:25:22 GMT From: rsalz@bbn.com (Rich Salz) Organization: BBN Systems and Technologies Corporation Sender: bug-bash-request@prep.ai.mit.edu Given these functions: TTY=`tty | sed -e s:/dev/ttyp::` host=`hostname | tr a-z A-Z | sed -e s/.BBN.COM//` function pwd() { # This has two ESCAPEs and one BACKSPACE in it. echo -n "^[]lBASH@${host}(${TTY}):$PWD^[\^H" } function cd() { builtin cd $*; pwd; } When I say "type pwd" my window banner gets all messed up. That's because you didn't use the -e flag on the echo command which would allow you to type in those escapes in ASCII representation: function pwd () { echo -n -e "\033]lBASH@${host}(${TTY}):$PWD\033\010" } Thanks for the neat function! Also, while I'm here: function bxmf() { make -k "$@" >foo 2>&1 & # It doesn't seem quite right that this next line is really needed... : ; } It isn't. You have mentioned this a couple of times. In 1.03, you don't even need to end the list with a terminator, but even in prior versions the newline character (or ampersand) is enough. function bxmf () { make -k "$@" >foo 2>&1 & } Brian Fox