From owner-freebsd-questions@FreeBSD.ORG Thu Sep 18 06:56:13 2008 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 EC6D21065675 for ; Thu, 18 Sep 2008 06:56:13 +0000 (UTC) (envelope-from amsibamsi@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mx1.freebsd.org (Postfix) with ESMTP id 763EE8FC23 for ; Thu, 18 Sep 2008 06:56:13 +0000 (UTC) (envelope-from amsibamsi@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so130418fgb.35 for ; Wed, 17 Sep 2008 23:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=pE9/C5gD632hk8El8fA9j4Xzt4h31vODPI2L7l1kBfs=; b=W/v6CZ7zfWOsewIcl0r/eUnh2uWgm+UARU86Yf+H025jDGkksm94q6mkMyd3u+xcC3 bw0InCRGrEU9fHCfCBzDYmRVqdqnhAohDnHfhkf66U4RNMHHblGRcw919rdYSSDgIo4W kZ2HvdMB9smnhmUh171WT4TFjsAnpZYifadaE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=yH8j0HK/lQQyH7TVwsY6wDZ2aYPOoDl8Qep1m0lov6V5u0t+uOaNqLwwVM2fmb16Au 0vU4ZC8wS+0asF5mdiZiPVbYFAjZo52pRf7bx+XXneH0+77KKdp0gRrXOSjSwifocAdt yM3MdAoUEfTrORsIQjOVoi6BGrLhuKtOBsksU= Received: by 10.86.36.11 with SMTP id j11mr390441fgj.7.1221720972159; Wed, 17 Sep 2008 23:56:12 -0700 (PDT) Received: from marvelman.marvels.xx ( [77.57.75.125]) by mx.google.com with ESMTPS id 4sm3728765fgg.4.2008.09.17.23.56.10 (version=SSLv3 cipher=RC4-MD5); Wed, 17 Sep 2008 23:56:11 -0700 (PDT) Message-Id: <544E50BF-EE1B-466A-A152-03AFA7688FAF@gmail.com> From: Anselm Strauss To: freebsd-questions@freebsd.org In-Reply-To: <11167f520809172208g655640b0w9a5ad0deb2e44f7e@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Date: Thu, 18 Sep 2008 08:56:09 +0200 References: <11167f520809172208g655640b0w9a5ad0deb2e44f7e@mail.gmail.com> X-Mailer: Apple Mail (2.929.2) Subject: Re: bash shell colors 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: Thu, 18 Sep 2008 06:56:14 -0000 Hi, I use something like this (heavily inspired by Gentoo): if [[ ${EUID} == 0 ]] ; then PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] ' else PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ' fi One could maybe also include a check of $TERM for different terminal types, not all of them will understand color escape sequences. And of course tools like ls and grep do colorized output themselves when called with appropriate options. This is described in the PROMPTING section of Bash's manpage. I did not find any documentation for the exact codes for ANSI color escape sequences. Anselm On Sep 18, 2008, at 07:08 , Sam Fourman Jr. wrote: > Hello list, > > I am looking to configure FreeBSD's Bash > can anyone post a config file that would make FreeBSD's Bash shell > color code like the default gentoo bash shell > > or if you have a config that you like and feel like posting it I will > take a look at it. > > > Sam Fourman Jr. > Fourman Networks