From owner-freebsd-questions@FreeBSD.ORG Tue Nov 24 11:19:51 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D367E106566C for ; Tue, 24 Nov 2009 11:19:51 +0000 (UTC) (envelope-from mail25@bzerk.org) Received: from ei.bzerk.org (tunnel490.ipv6.xs4all.nl [IPv6:2001:888:10:1ea::2]) by mx1.freebsd.org (Postfix) with ESMTP id 69E148FC17 for ; Tue, 24 Nov 2009 11:19:51 +0000 (UTC) Received: from ei.bzerk.org (BOFH@localhost [127.0.0.1]) by ei.bzerk.org (8.14.2/8.14.2) with ESMTP id nAOBJkiw081314; Tue, 24 Nov 2009 12:19:46 +0100 (CET) (envelope-from mail25@bzerk.org) Received: (from bulk@localhost) by ei.bzerk.org (8.14.2/8.14.2/Submit) id nAOBJkxA081313; Tue, 24 Nov 2009 12:19:46 +0100 (CET) (envelope-from mail25@bzerk.org) Date: Tue, 24 Nov 2009 12:19:45 +0100 From: Ruben de Groot To: Polytropon Message-ID: <20091124111945.GA80567@ei.bzerk.org> Mail-Followup-To: Ruben de Groot , Polytropon , FreeBSD Questions References: <20091124051038.1aef9ade.freebsd@edvax.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091124051038.1aef9ade.freebsd@edvax.de> User-Agent: Mutt/1.4.2.3i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (ei.bzerk.org [127.0.0.1]); Tue, 24 Nov 2009 12:19:49 +0100 (CET) Cc: FreeBSD Questions Subject: Re: Prompt containing SSH login information X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 11:19:51 -0000 On Tue, Nov 24, 2009 at 05:10:38AM +0100, Polytropon typed: > Hi, > > again, a strange question: I'd like to know if there is a builtin > means to let the csh's (or bash's) prompt show an information if > the current dialog session has been opened via SSH from another > system. The obvious is: > > me@sys1:~% ssh me@sys2 > me@sys2:~% _ > > I'd like the second prompt that I've been logged into sys2 by > sys1, such as > > me@sys1>sys2:~% _ > > or reverse > > me@sys2 > or something similar, like the complex form with different user > names, such as > > me@sys1:~% ssh bob@sys2 > me@sys1>bob@sys2:~% _ > > Is this possible with the means given by the shell? I read "man > csh", but found nothing that would fit. > > Maybe it's not possible (because not intended)... In tcsh there's the REMOTEHOST env variable. Don't know about bash. Something like: set prompt = "${USER}@${HOST}>${REMOTEHOST}> " should do it? Ruben