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 09-18-2005, 07:32 PM   #1
Gald3r
LQ Newbie
 
Registered: Sep 2005
Location: Athens, Greece
Distribution: RedHat 9
Posts: 24

Rep: Reputation: 15
.bash_profile question


The problem I face is that whenever I add let's say an alias command in this file and i log in again the new command does not correspond. I add the commands at the end of the file. Any ideas?
 
Old 09-18-2005, 07:38 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
When you say "Log in again" ... what exactly do you mean?
And: older aliases (ones you created in earlier sessions) do
work?


Cheers,
Tink
 
Old 09-18-2005, 07:46 PM   #3
Gald3r
LQ Newbie
 
Registered: Sep 2005
Location: Athens, Greece
Distribution: RedHat 9
Posts: 24

Original Poster
Rep: Reputation: 15
I mean log on again with the same account
None of the aliases nor the functions work, however they are in the file. (I put them at the end) A simple example... I add there the line : alias l='ls -l' When I return to the prompt (after logging on again) and write l I get an error message.
 
Old 09-18-2005, 07:49 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
In that case your "login" is probably not a login-shell at
all... try putting them in ~/.bashrc. Alternatively source
~/.bash_profile from ~/.bashrc.


Cheers,
Tink
 
Old 09-20-2005, 07:07 AM   #5
sunsane
LQ Newbie
 
Registered: Sep 2005
Location: INDIA
Distribution: Mandrake
Posts: 10

Rep: Reputation: 0
Gald,
Need not to worry you just forgot to do one little thing->
just write source .bashrc or .bash_profile(whichever you had edited)
and then see your aliases will work.

cheers
 
Old 09-20-2005, 09:10 AM   #6
vimal
Red Hat India
 
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260

Rep: Reputation: 34
Hi Gald3r,
You specified user aliases in the wrong file. user defined aliases must go into ~/.bashrc.
vimal,....
 
Old 09-20-2005, 12:54 PM   #7
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 23, 24, RHL 5.2
Posts: 560

Rep: Reputation: 56
You'll want to make sure that these lines are in your .bash_profile. This will execute your .bashrc when you login.
Code:
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
Also, can you show us what you wrote for alias commands? Perhaps this is part of the problem. It would also help to see your .bashrc and .bash_profile to verify if any of your alias' are being overridden.

Bill

Last edited by wmakowski; 09-20-2005 at 12:56 PM.
 
Old 09-20-2005, 02:01 PM   #8
mjjzf
Member
 
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879

Rep: Reputation: 39
That is true - it might be an alias format issue.
 
Old 09-20-2005, 07:17 PM   #9
Gald3r
LQ Newbie
 
Registered: Sep 2005
Location: Athens, Greece
Distribution: RedHat 9
Posts: 24

Original Poster
Rep: Reputation: 15
Thank you all, my problem is solved. I added them in my ~/.bashrc.
 
  


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_profile UmneyDurak Linux - General 1 10-17-2005 11:44 PM
.bash_profile wildcat22 Linux - General 3 04-13-2004 07:08 PM
.bash_profile question jalburger Linux - Newbie 1 03-18-2003 04:42 PM
.bash_profile Wasim Haider Linux - General 2 09-16-2002 07:12 AM
.bash_profile question abyss Linux - General 7 03-19-2002 11:04 AM

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

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