On Mon, Dec 05, 2005 at 03:26:12AM -0500, Willie Wong wrote

> from 'man tty'
> 
>    tty - print the file name of the terminal connected to standard input

  Thanks.  That simplifies things a bit, but it also prefixes with
"/dev/", so the revised script goes like so...

# If running interactively, then:
if [ "$PS1" ]; then

# Set up a separate HISTFILE, depending on which tty we logged in
# from.  Convert slashes in tty names (e.g. "pts/0") into underscores.
mytty=`tty | sed "s/\/dev\///
sx/x_xg"`
export HISTFILE="${HOME}/.history_${mytty}"

-- 
Walter Dnes <[EMAIL PROTECTED]> In linux /sbin/init is Job #1
My musings on technology and security at http://tech_sec.blog.ca
-- 
[email protected] mailing list

Reply via email to