Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-soc
Navigation:
Lists: gentoo-soc: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-soc@g.o
From: Robert Buchholz <rbu@g.o>
Subject: Re: Re: Progress on Universal Select Tool
Date: Thu, 23 Jul 2009 17:28:21 +0200
On Thursday 23 July 2009, Sérgio Almeida wrote:
> You changedir, you call uprofile, and
> voila, new profile. You login again, default profile.

Most shells have the ability to execute a command when a new prompt is 
generated. Users do not need to call uprofile themselves, they could 
set up their ~/.*shrc to do this.

For zsh (and tcsh), you can define a function:
       chpwd  Executed whenever the current working directory is
              changed.
       precmd Executed before each prompt.  Note that precommand 
              functions are not re-executed simply because the
              command line is redrawn, as happens, for example, when
              a notification about an exiting job is displayed.

For bash, you can set a variable:
       PROMPT_COMMAND If set, the value is executed as a
                      command prior to issuing each primary prompt.


You could utilize this to call uprofile, have it output environment 
variables and set them in the shell environment. A portable (bug ugly, 
code wise) way would be to do this as part of the PS1 variable.



Robert
Attachment:
signature.asc (This is a digitally signed message part.)
Replies:
Re: Re: Progress on Universal Select Tool
-- Sérgio Almeida
References:
Progress on Universal Select Tool
-- Sérgio Almeida
Re: Re: Progress on Universal Select Tool
-- Nirbheek Chauhan
Re: Re: Progress on Universal Select Tool
-- Sérgio Almeida
Navigation:
Lists: gentoo-soc: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Re: Progress on Universal Select Tool
Next by thread:
Re: Re: Progress on Universal Select Tool
Previous by date:
Re: Re: Progress on Universal Select Tool
Next by date:
Re: Re: Progress on Universal Select Tool


Updated Sep 12, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.