X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
Subject: Re: Running two different profiles based on user loggin
References: <2478543e0710120356u3afffbcas42d41d1f7706fa79@mail.gmail.com>
From: Markus E L <ls-cygwin-2006@m-e-leypold.de>
Date: Fri, 12 Oct 2007 13:11:49 +0200
In-Reply-To: <2478543e0710120356u3afffbcas42d41d1f7706fa79@mail.gmail.com> (Spencer  Bailey's message of "Fri, 12 Oct 2007 06:56:17 -0400")
Message-ID: <rkzlyoh9je.fsf@hod.lan.m-e-leypold.de>
User-Agent: Some cool user agent (SCUG)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com


"Spencer Bailey" wrote:

> Hi,
>
> I've created two different profiles in /etc. profile.1 and profile.2
> which both contain different aliases etc. Based on the user logging in
> I want to be able to run the correct profile.
>
> Is it possible to put in a check in the /etc/profile that is a certain
> user logs in to run the profile. Like...
>
> ---check for user "fred". If equal to fred
> . /etc/profile.1
>
> otherwise
>
> . /etc/profile.2


Generic Unix advice, untested, should work on cygwin AFAICS:

if test "$USER" = fred; then
   . /etc/profile.1
else
   . /etc/profile.2
fi

Regards - M


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

