You are not logged in.
Hi, after a daily pacman -Syu and updating the bash, i got a new pacnew. I'm not sure which parts should I merge, just wondering how to merge these guys :
/etc/bash.bashrc :
#
# /etc/bash.bashrc
#
# This file is the systemwide bashrc file. While most of the
# environment is preserved when running an interactive shell
# the PS[1-4] variables, aliases and functions are reset.
#
# When running a non-login shell, apply the following settings:
# - Prompt defaults (PS[1-4], PROMPT_COMMAND)
# - bash_completion if it exists
# - source /etc/bash.bashrc.local
PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
PS4='+ '
export PS1 PS2 PS3 PS4
if test "$TERM" = "xterm" -o \
"$TERM" = "xterm-color" -o \
"$TERM" = "xterm-256color" -o \
"$TERM" = "rxvt" -o \
"$TERM" = "rxvt-unicode" -o \
"$TERM" = "xterm-xfree86"; then
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
export PROMPT_COMMAND
fi
[ -r /etc/bash_completion ] && . /etc/bash_completion
[ -r /etc/bash.bashrc.local ] && . /etc/bash.bashrc.local
/etc/bash.bashrc.pacnew
#
# /etc/bash.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
PS4='+ '
case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
;;
screen)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
;;
esac
[ -r /etc/bash_completion ] && . /etc/bash_completion
Regards, Siavash.
Last edited by siavashserver (2011-02-14 05:31:51)
Offline
Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.
Offline
Thanks for the link, but I know how to merge them with Meld and I read that wiki page before.
I don't like to merge everything blindly, because last time made me to reset root password. I want to make sure that is it safe to completely replace the old one with the new one?
Last edited by siavashserver (2011-02-14 04:48:43)
Offline
Hmm, I got a pacnew for that file as well and I've never edited it. It looks to be safe to replace the old with the new.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Basically: If you changed anything to the base file of a .pacnew file - compare, understand the proposed changes and only then merge. If there is any doubt about what happend, ask (to the point, please).
If there was no change to the old files it might be safe to simply replace the old one with the .pacnew.
In any case: Backup your old files, by e.g. copying your old <file> over to <file>.old, before you touch anything.
Last edited by bernarcher (2011-02-14 06:40:55)
To know or not to know ...
... the questions remain forever.
Offline
Hey, I just did that update, and noticed that "/etc/bash.bashrc.local" is no longer executed... I was using that file to create my aliases. Is there another file that can be used for that purpose? (aliases that would work for all users.)
Offline
I think you have forgotten to keep the last line of your original "/etc/bash.bashrc" which I believe executes "/etc/bash.bashrc.local", correct me please if I'm wrong. BTW, here is mine after merging :
#
# /etc/bash.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
PS4='+ '
case ${TERM} in
xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
;;
screen)
PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
;;
esac
[ -r /etc/bash_completion ] && . /etc/bash_completion
[ -r /etc/bash.bashrc.local ] && . /etc/bash.bashrc.local
Offline
I think you have forgotten to keep the last line of your original "/etc/bash.bashrc" which I believe executes "/etc/bash.bashrc.local"
Well, yes... It is my understanding that that line was here to enable end-users to add things to their global bashrc without modifying /etc/bash.bashrc (thus not having to merge stuff at each update.) So I'm wondering why it was removed, and if there is an alternative mecanism in place to do the same thing.
Edit: in the meanwhile, I'll do like you and add it back...
Last edited by stqn (2011-02-21 20:08:16)
Offline
What exactly does the following code do:
[[ $- != *i* ]] && return
?
joe@trusktr.io - joe at true skater dot io.
Offline
Exactly what the line above it documents it doing...
Offline
Can you briefly explain the syntax?
joe@trusktr.io - joe at true skater dot io.
Offline
I had a look at bash's man page and while not extremely clear at first sight, I could find this information:
-i If the -i option is present, the shell is interactive.
- Expands to the current option flags as specified upon invoca‐
tion, by the set builtin command, or those set by the shell
itself (such as the -i option).
... So my guess is that if $- contains i, then the shell is interactive.
Offline