LinuxQuestions.org
Review your favorite Linux distribution.
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 04-11-2004, 03:44 AM   #1
Electronkz
Member
 
Registered: Mar 2004
Location: Punta del Este, Uruguay
Distribution: Fedora
Posts: 176

Rep: Reputation: 31
.bash_profile alias doesn´t seem to work


Hi, i am learning to write simple scripts, just to know a little more
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
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||||

Last edited by Electronkz; 04-11-2004 at 03:46 AM.
 
Old 04-11-2004, 03:49 AM   #2
Tih8710
Member
 
Registered: Jan 2003
Location: Finland
Distribution: ElementaryOS Freya as main, every other ubuntu-based as testing
Posts: 124

Rep: Reputation: 15
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...

Last edited by Tih8710; 04-11-2004 at 03:53 AM.
 
Old 04-11-2004, 04:17 AM   #3
Electronkz
Member
 
Registered: Mar 2004
Location: Punta del Este, Uruguay
Distribution: Fedora
Posts: 176

Original Poster
Rep: Reputation: 31
OOOppppsssss!!!
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
What a stupid i am
I guess it must be because in my country is very, very late, and i am very tired
Bye
 
  


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
sshd doesn`t work TiCkO Linux - Networking 12 02-11-2006 06:00 PM
Microphone doesn' work Lars79 Slackware 20 08-30-2005 10:24 AM
python doesn´t work little_ball Linux - Newbie 4 12-04-2004 10:09 AM
alias does not work until ". .bash_profile" pcoveney100 Linux - Software 4 06-04-2004 10:17 PM
PS/2 mouse doesn´t work :( teekaay Slackware 7 01-08-2004 03:22 AM

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

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