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 10-08-2004, 05:37 AM   #16
dustu76
Member
 
Registered: Sep 2004
Distribution: OpenSuSe
Posts: 153

Rep: Reputation: 30

Apart from the single-quotes (which I'm not exactly sure of), the variable PS1 has not been exported. The changes would otherwise not last beyond the current shell.

HTH.
 
Old 10-08-2004, 06:12 AM   #17
TLV
Member
 
Registered: Jun 2004
Distribution: Ubuntu
Posts: 185

Original Poster
Rep: Reputation: 30
It doesn't matter (as far as I can test) if I use single or double quotes...

However, it appears as if I was somewhat incorrect when I said that the dcop option didn't do what I wanted to do... [insert slightly embarrassed smiley here] It does change the title to "whatever_I_want - Konsole".

So my problem is solved. Thanks for your help everyone. The question remains though, why I can't adjust PS1 (to adjust the Konsole title) in a script. I've tried all your suggestions, but can't get it to work...

Thanks,
/TLV
 
Old 10-08-2004, 10:09 AM   #18
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
PS1 is set to a specific string every time you open a shell.
If you set PS1 in a script, and then a new shell is opened from that script, ~/.bashrc will be reread, changing the PS1 back to whatever is in ~/.bashrc. The only way I know to can change it from another script is to pass a variable with "export", and have the PS1 variable in ~/.bashrc set up to accept the exported variable. If PS1 isn't specified in ~/.bashrc the variable will be read from the global bashrc file.

You might be able to export PS1 from a script and put PS1="$PS1" in ~/.bashrc to prevent the global bashrc PS1 variable from being read. I haven't tested it, but I guess it might work.
 
Old 10-08-2004, 11:25 AM   #19
TLV
Member
 
Registered: Jun 2004
Distribution: Ubuntu
Posts: 185

Original Poster
Rep: Reputation: 30
Hmm, that makes sense. I was just wondering 'cos I never got the export part to work. But, there may have been other processes at work (e.g., PROMP_COMMAND) that made things not work as planned. For now I don't really have the time to dig deeper into shell-programming.

Thanks for the help.

/TLV
 
  


Reply



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
BASH Script: variable values referencing for console arguments sadarax Programming 1 11-14-2005 05:23 PM
how to change user in bash script c0d3 Programming 6 07-27-2005 11:34 AM
[Req]: How to config WebSvr & DNS Svr from console by Bash shell script CiF Linux - Networking 2 03-22-2005 12:31 AM
Change Text-File through bash script arkus Programming 2 12-17-2004 08:48 PM
Bash script to change a filename associated with an inode index number. Ziv Programming 22 06-19-2004 08:41 AM

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

All times are GMT -5. The time now is 12:49 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