LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-28-2004, 09:13 PM   #1
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
Shell modifications starting with the system


I have got my PS1= line just like I want it, but I can't get it to execute when the system starts.

I want the login prompt to also comply to what I have in PS1= (the color namely) so I tried to put "export PS1= yada yada" in rc.local. This did nothing.

Well, I figured that is because that line is really supposed to be in bashrc. So I put it in there, and again, nothing.

What am I doing wrong?

If I put my PS1= line in on the command line, it works fine, so why won't it work when it is any of the files that the machine runs at boot?
 
Old 05-29-2004, 12:59 AM   #2
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
rc.* files are used by sysvinit during the boot up, PS1 stuff is bash specific, not boot specific

so try /etc/profile

as thats the file bash is supposed to execute on startup
 
Old 05-29-2004, 01:13 AM   #3
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 45
put it in /etc/profile, like SciYro said for all users or ~/.bashrc for a single user. In your post above you didn't have a dot in front of the file name.
 
Old 05-31-2004, 10:00 PM   #4
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Original Poster
Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
I also tried it in "/etc/profile" (I forgot to mention that) and it didn't work there either.

I first tried to comment out the default Slackware PS1 line, and add mine in the same location, which didn't work, so then I added my PS1 line to the very bottom of the file (so nothing else in the file could overwrite the changes to the prompt) and that also did nothing. I am doing a full reboot after every change, by the way.

And I am aware that there is a . before bashrc.
 
Old 06-01-2004, 12:05 AM   #5
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Original Poster
Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
I got it to work.

The only place it would work was under "/etc/profile.d/" with it's own .sh script. That got the text after the login changed, so then I used escape codes in "/etc/issue" to get the login prompt to match.
 
Old 06-01-2004, 06:25 AM   #6
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,743
Blog Entries: 4

Rep: Reputation: 76
Even though you got it to work, it really should be in ~/.bashrc

Did you export it? ie: in .bashrc
Code:
export PS1="my kewl prompt $ "
# or
PS1="my kewl prompt $ "
export $PS1
 
Old 06-01-2004, 12:19 PM   #7
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Original Poster
Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
I tried that, and it didn't do anything.

Which I don't understand, since that file is supposed to be read when the user logs in, and I literally copied and pasted the "export PS1" line into the script I made under profile.d.

I'm happy with this though, since I wanted it to apply to everyone anyway.

Last edited by MS3FGX; 06-01-2004 at 12:22 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
An error Occurred during the file system check. Dropping you to shell; the system wil aneikei Linux - Newbie 3 02-11-2010 07:38 PM
modifications in a squashfs filesystem fenix4life Linux - General 2 11-10-2009 03:26 AM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 09:20 AM
How do I audit access or modifications to a folder? tisource Linux - Security 2 08-04-2005 08:26 PM
Unwanted modifications to fstab erika_Dec2004 Mandriva 1 04-10-2005 12:29 PM


All times are GMT -5. The time now is 05:19 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration