tumbleweed: where the @*!'#|... is the system setting PS1 (prompt environment variable)
All is well with my --ahm tumbleweed's-- prompts in e.g. konsole. But I want to find where it is set during system start. Searching resulted in ~/.bashrc, /etc/bash.bashrc and a load others but none are setting PS1 to the used "\[$(ppwd)\]\u@\h:\w>". Anybody knows where (and how) it is done?
|
Quote:
|
My system has no /etc/profile. There is an /etc/profile.d/ directory which contains files with bash-related names: "alias.bash" and "bash_completion.sh" both of which don't set PS1.
Nor is there any $HOME/.bashrc but an /etc/bash.bashrc which is not to be changed and there is no /etc/bash.bashrc.local. Code:
# /etc/bash.bashrc for SUSE Linux |
Have you tried creating the file by copying /etc/bash.bashrc to /etc/bash.bash.bashrc.local and then making changes to .local ?
|
Quote:
Quote:
|
TW has been migrating /etc/ to be a place only for admin files, not distro defaults. I wouldn't have been surprised to see nothing in /etc/ to copy to /etc/bash.bashrc.local, but it is there, and I do see PS1 strings in /etc/bash.bashrc starting 65% into the file. I can't read scripts well enough to see whether it should produce what you see, but when I do echo $PS1 as root, I get '\[\]\h:\w #\[\]'. As ordinary user it produces '\u@\h:\w>'.
|
Quote:
Code:
# Append any additional sh scripts found in /etc/profile.d/: From 'man bash' Quote:
And your local user's profile is in ~/.bash_profile, .bash_login, and ~/.profile, in that order and (TBone) not in ~/.bashrc. If they do not exist you can create them and set your own private PS1 string in there. |
I put this line in my own .bashrc file
Code:
export PS1 = '\U \W >' |
I looked into these files again. My current understanding is now that /etc/bash.bashrc is the culprit where the system gets its PS1. They are working with variables in the file though (e.g. "PS1="${HOST}:"'${PWD}'" # ""). That is why I didn't see the same as what "echo $PS1" produced.
Here is more explanation of SUSE's: Code:
me@PC:~> cat /etc/skel/.bashrc |
Need Help in Creating a Custom Prompt in Open SuSE 15.3 Leap
Quote:
The first thing I tried to do in Open SuSE is to modify the prompt in /etc. The first shock came when I discovered that there is NO /etc/bashrc, but DID FIND a /etc/bash.bashrc. The second shock was the opening lines PLEASE DO NOT CHANGE /etc/bash.bashrc... Instead use /etc/bash.bashrc.local. There is, of course, no /etc/bash.bashrc.local so I simply copied /etc/bash.bashrc and saved it as /etc/bash.bashrc.local, and then modified that file and added my custom PS1 command, saved the file and rebooted. DISASTER!! I was no longer able to login, and my buddy gave me a hand so I could access root, ran mc, and DELETED my /etc/bash.bashrc.local file and rebooted. Now I am back to where I started, but at least I am able to login. SuSE is STRANGE: Perhaps someone can illuminate me? 1) What is this "... .local" file? There are no ".local" files. When I COPIED /etc/bash.bashrc and appended "... .local" to it, my machine had a fit. 2) What is this /etc/profile which we are admonished NOT TO CHANGE, as well as the non-existent /etc/profile.local? Here is my CentOS prompt in the file /etc/bashrc (no /etc/bash.bashrc): [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="\[\033[1;32m\][\[\033[1;33m\]\u\[\033[1;36m\]@\h\[\033[1;31m\]\w\[\033[1;32m\]]\[\033[1;35m\]/>\[\033[1;37m\]" 3) Assuming that I was correct by copying /etc/bash.bashrc => /etc/bash.bashrc.local perhaps someone can tell me WHERE exactly in that file I should copy the above prompt statement in that enormous file. If not COPY what do I need to MODIFY in that statement to make it work? Obviously I did not do something right, as by machine threw a hissy fit. Any HELP would be greatly appreciated. |
Quote:
openSUSE by default sets root's prompt foreground color red, while white/gray for dark backgrounds and black for light backgrounds, and shows fullpath, and login name, so tells me all I need to know from a prompt. If I see ~ in a prompt, and no red either, I know I'm not root. So, openSUSE's prompts have not had reason to catch much interest from me since I learned they could be changed, sometime last century, long pre-SuSE. /etc/bash.bashrc.local is like /etc/profile.local, and /etc/systemd/system/local-after-boot.service, and /etc/systemd/system/local-after-boot.timer, optional, existent only where an admin created it. bash.bashrc.local I don't use. The first of the others I've used since around SuSE Linux 8.2 or so. My oldest backup of profile.local, with only a umask line in it, is 16 years old. My current one has three lines in it, written 4 years ago. These optional files are supposed to contain only differences from, or additions to, defaults, so there's no reason for them to exist in a fresh installation. |
Quote:
Quote:
A final question -- for living life on the Wild Side -- could I simply copy my /etc/bashrc file from CentOS and copy it into openSUSE 15.3?? or is SUSE so messed up it would not read the /etc/bashrc file... or worse cause SUSE to have a spectacular meltdown? Any help yopu copuld provide would be appreciated. |
Quote:
Code:
# uncomment for a colored prompt, if the terminal has the capability; turned
If you haven't read /etc/skel/.bashrc, it might be worth it as a guide to how bash and shell configuration works on openSUSE. Surely it should be on https://doc.opensuse.org/ somewhere in more detail. I wouldn't mess with prompt configuration anywhere in /etc/ without first figuring out how it works on a per user basis. cf. https://forums.opensuse.org/showthre...28#post2198228 Sorry I can't be more helpful. Maybe asking on openSUSE's own forums or mailing lists would find someone knowledgeable on this subject. |
Quote:
In other news... I just blew up SUSE this morning while trying to install some program -- I toasted it good!! I am doing a complete new install even as I type this. IF -- BIG IF -- I can hack KDE 5.xy.z -- and I am very, very, close -- assuming I can solve the prompt problem -- promptly !! -- openSUSE 15.3 will rise to the top of the Candidates file. Right now SUSE is a learning experience with a STEEP learning curve. Then it will be on to Rocky Linux 8.4 Stable. I've still have several hacking days ahead of me with openSUSE. The question remains how many more times will I nuke SUSE before I get the hang of it. Again thanks for your help. D'Cat |
The openSUSE forums are here: https://forums.opensuse.org/ HTH.
P.S.: Funny, I got no message that there were new posts in this thread *head scratch* ... |
All times are GMT -5. The time now is 03:51 PM. |