LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 05-14-2006, 09:38 AM   #1
ellion
LQ Newbie
 
Registered: May 2006
Posts: 21

Rep: Reputation: 15
Bash me over the head...


Got slackware 10.2 installed.

If i call alias..

I get .

d dir
dir /bin/ls $LS_OPTIONS --format=vertical
ls /bin/ls $LS_OPTIONS
mc source /usr/share/mc/bin/mc-wrapper.csh
v vdir
vdir /bin/ls $LS_OPTIONS --format=long


now. if I then type

alias listall='ls -all'
or
alias lsl='ls -all'

then nothing happens, it does not get added to those already there.. Strange.

If I do this when logged in as root(not su root but looged in) then it works but only for that session so it dont save anything.

I googled this and iv since made.

.bashrc
.bash_profile

in my home drive with the above alias in it to test. and this is not doing anything at all.

Iv tried looking for the above "mc source /user/...." to try and find the file that these default slackware aliases are stored but i cant even find those.

ELP.. pls.
 
Old 05-14-2006, 10:57 AM   #2
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Rep: Reputation: 30
Did you logout and then log back in after creating the .bashrc file? bash reads that file and loads your aliases only on login AFAIK.

-geo
 
Old 05-14-2006, 11:56 AM   #3
ellion
LQ Newbie
 
Registered: May 2006
Posts: 21

Original Poster
Rep: Reputation: 15
well yeah, iv logged in and out loads of times sice .. iv bee playing with it all morning.

What I dont understand is why i cant find the file thats holding those default alias's..

cos if i find that i can just add my own to it.
 
Old 05-14-2006, 02:37 PM   #4
geomatt
Member
 
Registered: Mar 2004
Location: PA
Distribution: Slackware 12.0
Posts: 315

Rep: Reputation: 30
Here's what the bash man page says:
Code:
When  bash is invoked as an interactive login shell, or as a non-interactive shell 
with the --login option, it first reads and executes  commands  from  the file
/etc/profile, if that file exists.  After reading that file, it looks for
~/.bash_profile, ~/.bash_login, and ~/.profile, in  that order, and reads 
and executes commands from the first one that exists and is readable.
On my slack 10.2 system the default /etc/profile does not have any aliases. All are in my /home/username/.bashrc file. All I can say is make sure that .bashrc is in the right directory and make sure it is readable. It should be very straightforward to add aliases. Is bash your login shell? Check with

Code:
set | grep SHELL
-geo
 
  


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
Bash: Print usage statement & exit; otherwise continue using Bash shorthand operators stefanlasiewski Programming 9 02-07-2006 05:20 PM
Multi-monitor Issues on RH9, Geforce 4 Ti Dual Head + TNT2 Single Head the letter b Linux - Newbie 3 12-04-2004 11:23 PM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 06:42 PM
DirectColor,16bits, Wall, Head, Bash PhilShaw Linux - Hardware 0 11-11-2003 04:48 AM
x86 Solaris 9 XSun and Matrox G550 dual-head... one head down, one to go. finegan Solaris / OpenSolaris 4 03-11-2003 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration