LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   .bash_profile alias doesnīt seem to work (https://www.linuxquestions.org/questions/linux-newbie-8/bash_profile-alias-doesn%B4t-seem-to-work-168698/)

Electronkz 04-11-2004 02:44 AM

.bash_profile alias doesnīt seem to work
 
Hi, i am learning to write simple scripts, just to know a little more :cool:
i am learning from this site http://gd.tuwien.ac.at/linuxcommand.org/wss0020.html
i have a problem with writing an alias in .bash_profile at home directory
I write the alias like the site said: "at the end of the file add alias l='ls -l' "
And then i log out and nothing happened, i modify the alias in the file just in case something was wrong, and nothing happened, then i even reboot my PC, and nothing :scratch:
So what happened???
I checked with the alias command at the command prompt and the alias i added wasnīt on the list.
Then I edit .bashrc the same way, i logged out, logged in again, and the alias worked fine,
My question is: Why editing the .bash_profile didnīt work??
Info: I use vim to edit files, and here is the output for .bash_profile at home directory:

Code:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
alias today='date +"%A, %B %-d, %Y"'

Oh and one more thing, why there is another .bash_profile in /etc/skel ??
Does it add the aliases for all the users??
Thanks,
Bye
|||Electronkz||||

Tih8710 04-11-2004 02:49 AM

well, I don't know about .bash_profile, but I use aliases in ".bashrc" and they work just fine.

Dmn, Should have read the thread before answering... In that script, .bash_profile, there's a few lines like:


if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

That checks weather .bashrc exists, and if does, loads that file. So either put aliases there, or in .bash_profile BEFORE the if - line...

Electronkz 04-11-2004 03:17 AM

OOOppppsssss!!!:cry: :(
I should have read in the site i mentioned a little more, at the bottom of the page it is explained!! :(
Sorry for this silly question,
And thanks for the reply anyway
Always :study:
What a stupid i am :(
I guess it must be because in my country is very, very late, and i am very tired
Bye


All times are GMT -5. The time now is 09:11 AM.