Alex Williamson writes:
> I am trying to replace newlines with tab in a file which lists words
> on seperate lines. (Which is displayed within a larger script. I
> don't want to endlessly scroll to see the whole thing.)  I'm piping
> cat to tr. [ cat  filename | tr \n \t ]. The tr man page says that
> this should display the normal filename output with a display that
> replaces new line characters with tabs.  Instead n is replaced with t
> and the words remain on seperate lines.  Searching in less with these
> escaped characters behaves the same way. What gives?

You need to quote the escape sequences, otherwise the shell will interpret
them.  Also, there is no reason to use cat:

tr '\n' '\t' < filename

> Also, I'm running putty as an ssh from an Win2k machine to my linux
> machine.  Man pages show [ - ] as [ an a with ^ above it. ], which
> drives me crazy trying to read. Telnet from a command promt is even
> worse.  More characters don't scan.  Any fixes?

Starting with the default PuTTY settings, this is what you should change for
Linux (at least for Debian Linux):

Window -> Translation -> Use font in both ANSI and OEM modes
Connection -> Terminal-type string = xterm

For FreeBSD:

Terminal -> Use background color to erase screen
Connection -> Terminal-type string = xterm-color

You can actually use the FreeBSD ones for Linux, but they don't make any
difference (as far as I can tell).

Also, this is a very handy snippet from my .bashrc:

if [ "$PS1" ]; then
    case $TERM in
    xterm*)
        declare -x PROMPT_COMMAND="echo -ne '\033]0;${HOSTNAME}\007'"
        ;;
    esac
fi

-- 
David Phillips <david at acz.org>
http://david.acz.org/


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list