[Bug 497765] Re: Karmic does not set PS1 correctly in /etc/profile

gzarkadas 497765 at bugs.launchpad.net
Wed Jul 6 19:57:01 UTC 2011


This is **not** a bug.

The $PS1 variable is set when sh / bash are started as interactive
shells (that is shells that allow the user to enter commands and view
the output). So the test checks whether the shell is interactive and if
it is executes code that is intended for interactive shells only.

So the logi is correct. If you want to customise PS1, do it inside the
if part of the conditional.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to base-files in Ubuntu.
https://bugs.launchpad.net/bugs/497765

Title:
  Karmic does not set PS1 correctly in /etc/profile

Status in “base-files” package in Ubuntu:
  Invalid

Bug description:
  Binary package hint: base-files

  /etc/profile contains wrong logic for PS1 (see below)
  Here the condition is entered when PS1 is already set otherwise nothing is done.
  That does not make sense to me.
  I think it should read if [ -z "$PS1" ]  or something similar, so that PS1 gets set if it is not already set.

  if [ $PS1 ]; then
    if [ "$BASH" ]; then
     ...
    else
     ...
    fi
  fi

  ProblemType: Bug
  Architecture: i386
  Date: Thu Dec 17 14:41:58 2009
  DistroRelease: Ubuntu 9.10
  Package: base-files 5.0.0ubuntu7
  ProcEnviron:
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcVersionSignature: Ubuntu 2.6.31-16.53-generic
  SourcePackage: base-files
  Uname: Linux 2.6.31-16-generic i686
  XsessionErrors:
   (gnome-settings-daemon:2058): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
   (gnome-settings-daemon:2058): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
   (nautilus:2090): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
   (polkit-gnome-authentication-agent-1:2114): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
   (firefox:3303): GLib-WARNING **: g_set_prgname() called multiple times

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/497765/+subscriptions




More information about the foundations-bugs mailing list