LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Slack7.1- (.bash_profile/.bashrc)? (https://www.linuxquestions.org/questions/linux-newbie-8/slack7-1-bash_profile-bashrc-8032/)

shmoo28 10-27-2001 05:20 PM

Slack7.1- (.bash_profile/.bashrc)?
 
I just installed and now I want to set up some aliases and such in bash shell. I understand that this can be done through modification of the .bashXXX files. One problem...these files are nonexistant, I swear, I looked everywhere (using ls -a, find, whereis, etc.). Do I need to create them myself? If so where do I put them and how do I make them execute on login? Also, if I want to make a user account to work with (which I'm told is a good idear) will these files automatically be appended to the /home directory of the new account? ACK! I'm drowning.

That should be enough for now, if you enjoy answering questions, I have a full queue, so let me know. Thanks

acid_kewpie 10-27-2001 05:47 PM

maybe youre' not using bash for some reason, those files really really should be ni your user dir if you're on bash.

check
set | grep SHELL

you can create global aliases by setting them up in /etc/bashrc just the same i think

paavaka 10-27-2001 07:02 PM

Stop me if I am wrong, but in Slackware you should you have a master bashrc file in /etc...
as the root user, try 'find /etc/ -name bashrc'
If there is one (and I am pretty sure there is), then copy it to your home directory as '.bashrc'. I know there is a master 'profile' (sh) file there. If not, then just create it yourself... everything that is important for everyone to have should already be set for you, and just put anything you want to add or override in yours. Bash knows where to look.

And if you want files to be automatically created when a new user account is created (and believe me, in Slack this is NOT automatic!).. place them in '/etc/skel'. Any new user will inherit these files with the appropriate permissions.

HTH

shmoo28 10-28-2001 01:03 AM

First off, thank you for the input.

The bad news: There is no bashrc, .bashrc, or anything like that anywhere that I can find, and I checked about 1,714 directories.

The good news: I was able to find /etc/profile, which automatically executes on login (I stuck an echo command in there to check). The last section of that file goes something like this:

for file in /etc/profile.d/*.sh do
if [ -x $file]; then
. $file
fi

Seeing this, I checked in /etc/profile.d/ and there is a script in there that also runs on login, giving me a quote of the day...whoopee. So I tried to make my own script by the name of "alias.sh" that would set my aliases for me, but no dice. I assume it's the -x part in the if[] statement, and that this has something to do with permissions, but I could be totally wrong, being a noob and all.

Time to go try out the chmod command. Thanks again.

acid_kewpie 10-28-2001 04:08 AM

well, i'd guess you're not using bash, probably just sh.

if there is an /etc/bashrc DON'T copy it to your user area as .bashc, as they do different things. well, actually my .bashrc oesn't do anything different:
---------
[chris@trevor chris]$ cat .bashrc
# .bashrc

# Source global definitions
if [ -r /etc/bashrc ]; then
. /etc/bashrc
fi

alias p=pine
--------

well, it has an alias, but other than that all it does is call the global bash script anyway.

to chaneg your shell use 'chsh'


All times are GMT -5. The time now is 06:58 AM.