SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I feel kind of silly for asking this, but it's really bugging me. I've written a script that changes the color of my prompt and also changes my title of my X terminals. This script works fine if I type it, but for some reason it doesn't work when used as an executable script. Here's the script...
I get no errors with this script but 'export' doesn't seem to be executed. I don't know of an absolute path for 'export' and coule not find one even using slocate.
thanks for the help Using the 'source' command made the script work correctly. For now I like being able to use this script on individual X terminals. However, if I did want to start an X session so that all started x terminals would have my prefs set how would I do this? I'm currently using Xfce. I thought calling the script in one of the .xinitrc files might do it but I'm not sure. Ideally I could simply activate this manually from the console before starting X, so I would have the choice of whether or not I wanted the prefs on.
Another question I have concerning this topic is how to change the colors for 'ls' I tried exporting new values for LS_OPTIONS but this seemed to have no effect. I get some of what I want if I su - to a user, but I shouldn't need to do this.
Any helpful information on any of this would be greatly appreciated.
I think I know what's the problem. By default terminals in X are not run as login shells so they won't read .bash_profile nor /etc/profile files. They will however, read .bashrc. You can find more about this reading bash man page (INVOCATION section).
To "solve" this and always load the values you want, you've to create a .bashrc file in your home folder with this content:
Code:
if [ -f ~/.profile ]; then
source ~/.profile
fi
And then create one called .profile also in your home folder with the things you want, like:
awesome! Thank you very much! The .bashrc file gets loaded at every X terminal startup. To disable this, of course, I simply change the file name. In addition, I noticed that when I su - the accounts .profile file gets loaded. Thank you again!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.