LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-02-2003, 10:30 PM   #1
psyklops
Member
 
Registered: Jan 2002
Location: Los Angeles
Distribution: RedHat 9.0
Posts: 216

Rep: Reputation: 30
errors in .bash_profile


I have a couple of alias' in my .bash_profile. Im not sure how they got there but they have been causing my terminal to prompt an error on each of their respective lines.

If Im not mistaken I thought that .bashrc was used for alias' and .bash_profile was used for pathing info. Could this be the cause of the errors? Should I remove the lines...

alias l='ls -l'
alias today='date+"%A,%B%-d,%Y"

...because neither give any output when I enter them.
 
Old 09-02-2003, 10:33 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
bash_profile is used in login shells and bashrc for non-login. If you're running an xterm and launch another with 'rxvt -ls' the aliases should work. Remove them if you don't like them; use them if you do.

Assuming RH doesn't do something bizarre.

-- And they got there by RH putting them in, probably.

Last edited by slakmagik; 09-02-2003 at 10:34 PM.
 
Old 09-02-2003, 10:58 PM   #3
psyklops
Member
 
Registered: Jan 2002
Location: Los Angeles
Distribution: RedHat 9.0
Posts: 216

Original Poster
Rep: Reputation: 30
Yeah I believe RH put em in there. However when I run the

rxvt -ls

in bash it errors: command not found.

I ran a locate...

psyklops@mobilenode00 psyklops]$ locate rxvt
/usr/share/terminfo/r/rxvt-16color
/usr/share/terminfo/r/rxvt
/usr/share/terminfo/r/rxvt-basic

then ran /usr/share/terminfo/r/rxvt with and without the options, but I recieved a permission denied error even while running as su-. Weird.
 
Old 09-02-2003, 11:03 PM   #4
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
Those things aren't the program judging from the location so no one has execute permissions (check the file permissions with ls -l to see this). rxvt is probably not installed. But what's this got to do with your bash_profile?
 
Old 09-02-2003, 11:40 PM   #5
psyklops
Member
 
Registered: Jan 2002
Location: Los Angeles
Distribution: RedHat 9.0
Posts: 216

Original Poster
Rep: Reputation: 30
Alright to some up I checked out a site on scripting and found out what my problem was. This is a copy of my .bash_profile with both alias' returning errors.

#.bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/sbin

alias l='ls -l'
alias today='date+"%A,%B%-d,%Y"'

export PATH
unset USERNAME

#end of file.

Now this is a copy of .bash_profile with the changes I made to allow the alias to function.

# .bash_profile

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

alias l='ls -l'
alias today='date+"%A,%B%-d,%Y"'

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/sbin


export PATH
unset USERNAME

#end of file.

Those scripting gurus out there can see what I did wrong. For those of us less fortunate, the alias commands must be put below the if - fi function.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.bash_profile dimi Linux - General 1 08-23-2005 08:00 PM
.bash_profile nguye103 Linux - Software 3 10-22-2004 01:48 PM
.bash_profile praveenv Linux - Newbie 3 08-14-2004 12:58 PM
need .bash_profile example true_atlantis Slackware 2 02-07-2004 06:27 PM
.bash_profile sikandar Linux - Software 9 08-31-2003 10:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:06 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
Open Source Consulting | Domain Registration