LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bash me over the head... (https://www.linuxquestions.org/questions/linux-newbie-8/bash-me-over-the-head-444659/)

ellion 05-14-2006 09:38 AM

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.

geomatt 05-14-2006 10:57 AM

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

ellion 05-14-2006 11:56 AM

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.

geomatt 05-14-2006 02:37 PM

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


All times are GMT -5. The time now is 11:56 PM.