Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.