Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Differrent prompt for remote machines



On Mar 30, 12:48pm, Dominik Vogt wrote:
}
} On Fri, Mar 30, 2001 at 01:59:33PM +0400, Andrej Borsenkow wrote:
} > On Fri, 30 Mar 2001, Dominik Vogt wrote:
} > 
} > >   Basically it breaks down to detecting if the shell runs on a
} > >   local terminal or through a network connection.
} > 
} > One possibility is to use finger (is it available on all systems?)
} > Solaris supports who -m

There's also `last -adn 1 $LOGNAME' on linux, which will attempt to reverse
map an IP address if the remote host name is not stored in wtmp.

} Thanks, I got it working with 'who -m | cut -d "!" -f 1'.

Quicker is ${"$(who -m)"%%\!*}

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author