LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-27-2001, 06:20 PM   #1
shmoo28
LQ Newbie
 
Registered: Oct 2001
Location: LA,CA
Distribution: Slackware 7.1, if you can call what I do with it "use"
Posts: 7

Rep: Reputation: 0
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
 
Old 10-27-2001, 06:47 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
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
 
Old 10-27-2001, 08:02 PM   #3
paavaka
Member
 
Registered: Jun 2001
Location: Virginia
Distribution: Slackware,Debian,SuSE
Posts: 43

Rep: Reputation: 15
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
 
Old 10-28-2001, 01:03 AM   #4
shmoo28
LQ Newbie
 
Registered: Oct 2001
Location: LA,CA
Distribution: Slackware 7.1, if you can call what I do with it "use"
Posts: 7

Original Poster
Rep: Reputation: 0
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.
 
Old 10-28-2001, 05:08 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
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'
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
bashrc vs. bash_profile mikeshn Linux - General 9 02-10-2008 02:46 PM
bashrc and .bash_profile happy78 Programming 5 10-19-2005 05:26 PM
bashrc or bash_profile ? ARCIS_house Linux - Newbie 6 07-21-2005 03:09 PM
~/.bashrc, ~/.bash_profile Sinope Linux - Newbie 6 08-17-2004 03:40 AM
.bashrc or .bash_profile? statmobile Linux - Newbie 1 02-04-2004 10:08 PM


All times are GMT -5. The time now is 04:37 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration