LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-22-2004, 08:55 AM   #1
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Rep: Reputation: 30
making alias, can't find .bashrc file


i'm using kernels 2.4.24 on slackware 9.1, and i want to start making alias for my bash shell. but when i go to my home directory i can't find that find.
i even did a ls -a command and still no file. does slackware put the bash profiles stuff somewhere else?
 
Old 07-22-2004, 08:58 AM   #2
oot
Member
 
Registered: Dec 2002
Distribution: Slackware 12.0
Posts: 240

Rep: Reputation: 30
Just create it. If it's there, it will be used. If it isn't there, it will be ignored and /etc/profile will be used.
 
Old 07-22-2004, 09:20 AM   #3
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
so i can touch ~/.bashrc
and just type:
alias cp='cp -iv'

save it, and be able to use it on the fly.
 
Old 07-22-2004, 09:58 AM   #4
oot
Member
 
Registered: Dec 2002
Distribution: Slackware 12.0
Posts: 240

Rep: Reputation: 30
Yes and no. You need to give it a first line of #!/bin/bash.
So, what you'd end up with is
Code:
#!/bin/bash
alias cp='cp -iv'

Last edited by oot; 07-22-2004 at 10:00 AM.
 
Old 07-22-2004, 10:07 AM   #5
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
sweet thanks, i'm gonna try that when i get home from work. i love this website!!
 
Old 07-22-2004, 10:42 AM   #6
mijenks
Member
 
Registered: Mar 2004
Location: NY
Distribution: Gentoo
Posts: 112

Rep: Reputation: 15
Slack (at least as of 9.1) does not create a .bashrc file for you, you have to create it yourself. I'm not too sure that you even need to put #!/bin/bash in the file, but it can't hurt, I'm sure. Good luck.
 
Old 07-22-2004, 10:45 AM   #7
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
do you know why slackware 9.1 doesn't include a .bashrc file? that seems sort of werid
 
Old 07-22-2004, 05:30 PM   #8
oot
Member
 
Registered: Dec 2002
Distribution: Slackware 12.0
Posts: 240

Rep: Reputation: 30
It doesn't include it because it can use /etc/profile instead. If all users start off with the same default settings, there's no reason to duplicate the settings in a lot of files, so everyone gets /etc/profile to start off with. If they want to customize, that's what .bashrc and .profile are for.

Speaking of which -- djgerbavore -- I may have told you wrong on which file to use. It depends on when you want it to run. If you use .bashrc, when you log in, it apparently won't run, but when you launch an xterm, it will. If you use .profile, when you log in, it will run, but it will not run when you launch an xterm. If you want it to run for both a terminal where you log in AND an xterm, then you need to put the same thing in BOTH .bashrc and .profile. Sorry I wasn't clearer about this earlier.
 
Old 07-22-2004, 05:39 PM   #9
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Rep: Reputation: 30
Get Slacked!

Quote:
Originally posted by djgerbavore
do you know why slackware 9.1 doesn't include a .bashrc file? that seems sort of werid
in comparison to other distros, yes that does seem a little bit silly not to include something as basic as this.... but you... now you've learned something new!

and this is actually i think the number one reason why people get hooked on Slackware... always something new to learn and with it comes the sense that you actually know what you at!

so just keep on Slacking!

- perry
 
Old 07-22-2004, 05:47 PM   #10
Bebo
Member
 
Registered: Jul 2003
Location: Göteborg
Distribution: Arch Linux (current)
Posts: 553

Rep: Reputation: 31
I've solved this .bashrc and .profile thing by creating an /etc/bashrc file which I source from within /etc/profile. And then I make a symlink from ~/.bashrc to /etc/profile. That way, every user will have the same aliases and stuff, independent on whether it is a login shell or interactive shell, or whatever.
 
Old 07-23-2004, 08:23 AM   #11
djgerbavore
Member
 
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 458

Original Poster
Rep: Reputation: 30
hey thanks guys, i got it working. slackers are the most helpful people. i think that is why i like slackware so much. thank guys. time to party.
 
  


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
making aliases - no bashrc file disorderly Linux - Newbie 9 09-27-2004 04:57 PM
where could i find the file bashrc Paxmaster Linux - Software 4 07-15-2004 01:47 PM
My first alias in .bashrc...'apostrophes 'getting' in the way?' Baix Linux - Newbie 3 06-17-2004 02:36 PM
alias and .bashrc whaase Linux - General 3 11-02-2003 07:03 PM
alias and bashrc Haldir Linux - Newbie 3 06-14-2002 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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