LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-14-2017, 02:21 PM   #1
TheStr3ak5
Member
 
Registered: Feb 2016
Location: Zaragoza, Spain
Distribution: Xubuntu, Tails, etc.
Posts: 55

Rep: Reputation: 9
Question Bash: Help with configuration of shell


Hi friends, i will explain myself, the tittle ik is a little bad formuled.
I am making a linux system from scratch following half lfs and blfs book and half other sources.
When i boot in the system and choose the user i have a problem (only stetic, nothing funcional), in most distros when you start terminal it puts the user and the hostname of the pc, but in my chase only puts the name of the shell (in my chase bash and the version), i have searched about it and revised both /.bashrc and profile files of the shell to find the problem but it doesnt seems bad.
Someone knows how to fix it? Thanks in advance and sorry if it is bad explained, i´m not very good at english.
 
Old 02-14-2017, 02:27 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
Quote:
Originally Posted by TheStr3ak5 View Post
Hi friends, i will explain myself, the tittle ik is a little bad formuled.
I am making a linux system from scratch following half lfs and blfs book and half other sources.
When i boot in the system and choose the user i have a problem (only stetic, nothing funcional), in most distros when you start terminal it puts the user and the hostname of the pc, but in my chase only puts the name of the shell (in my chase bash and the version), i have searched about it and revised both /.bashrc and profile files of the shell to find the problem but it doesnt seems bad.
Someone knows how to fix it? Thanks in advance and sorry if it is bad explained, i´m not very good at english.
Examine the bash man page and look for discussion of the PS1 and PS2 variables.
Now check the startup files under /etc, etc/profile.d, and those under the users home to find where these are set. Ones you change under /etc change them for all users on the server, so take care. Changing those under the users home only affect that user, so there is less risk.
 
Old 02-14-2017, 02:37 PM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,310
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Agreed. Finding the mentions of the PS1 and PS2 variables in the bash manual will get you far. The fun stuff, including a lot of abbreviations, is in the section PROMPTING.

Code:
man bash
 
Old 02-14-2017, 02:38 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Typical PS1 on a centos system is:

Code:
[\u@\h \W]\$
which looks like

Quote:
[root@centos-box ~]#
 
Old 02-14-2017, 02:54 PM   #5
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,794

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
The default prompt for bash is e.g "bash-3.2$ " for lusers and "bash-3.2# " for root, where 3.2 is the bash version.
So there is nothing wrong with it.
Some distros set a user@hostname prompt in /etc/profile and /etc/bash.bashrc, they run before the user's .profile and .bashrc, respectively.
If your distro does not, then the administrator can provide it in the /etc/ files for all users on the system, or each user can do it in her .profile and .bashrc files.
If you go for the /etc/ files: some distros have them run /etc/profile.d/*.sh files, then you simply add a .sh file with the desired prompt. Some distros provide optional shell packages with files in /etc/profile.d/, so please check before you re-invent the wheel.
 
Old 02-15-2017, 10:25 AM   #6
TheStr3ak5
Member
 
Registered: Feb 2016
Location: Zaragoza, Spain
Distribution: Xubuntu, Tails, etc.
Posts: 55

Original Poster
Rep: Reputation: 9
Thanks all for that really quick reply, i throught it will cost around 2 days to get a answer about this kind of specific issues.
I saw all replies and all aported a lot of info about the config, just modified the PS1 variable in /etc/profile with the PS1 content of szboardstretcher and started to see color in my screen, then revised the files of /skel/ and actualized it in the directory and in the home folders of all users ,modifing it with the new variables and advices with you sayed and all started work fine!, the only problem i have now is that i need to make the system bootable using GRUB, but that is other story, and i dont expect any problems about it, thanks all!
 
Old 02-15-2017, 01:44 PM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
you can try something like this too: https://www.kirsle.net/wizards/ps1.html
 
  


Reply

Tags
bash, shell, shell prompt, terminal



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh from solaris 9 with a bash shell of 2.0 to suse 3.2 bash shell slufoot80 Solaris / OpenSolaris 3 09-19-2012 03:06 PM
ssh from solaris 9 with a bash shell of 2.0 to suse 3.2 bash shell slufoot80 Solaris / OpenSolaris 1 09-19-2012 01:19 PM
[SOLVED] bash shell scripting for samba configuration ramecare Linux - Server 8 04-05-2011 10:04 AM
BASH Shell program Read a configuration File minil Programming 10 01-17-2005 04:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration