LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-30-2003, 11:27 PM   #1
VxJasonxV
Member
 
Registered: Apr 2003
Location: Mesa, AZ
Distribution: RH9, LFS5, Knoppix 3.2/3.3 (Live), FC1, FC2, MDK10CE, MDK10OE, Gentoo
Posts: 51

Rep: Reputation: 15
Make Screen respect bash aliases


Ok.
I have many productive aliases set for myself, but I very frequently use `screen`. The only problem is, my aliases don't stick around when I use screen, they revert to the defaults.

As a matter of fact, I can't even find where those defaults are.
I looked (obivously) in my own .bashrc, and /etc/bashrc, and checked other bash files but they're not there!

Basically, I have ll definated as ls -laF instead of just ls -l among other things.
So why does screen reset it's definition? (And where in the hell are those normal defaults? [rm = rm -i, cp = cp -i, mv = mv -i, ll = ls -l, etc.])
 
Old 12-31-2003, 09:16 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Try looking in /etc/profile.
I have never had any problems with screen screwing up my aliases though. Do you define them in your .bashrc? If so, is .bashrc included in .bash_profile? If not you can make .bash_profile call .bashrc so .bashrc always will be parsed. Include this in your .bash_profile:
Code:
if [ -f ~/.bashrc ]; then
    source ~/.bashrc
fi
Håkan
 
Old 12-31-2003, 03:55 PM   #3
VxJasonxV
Member
 
Registered: Apr 2003
Location: Mesa, AZ
Distribution: RH9, LFS5, Knoppix 3.2/3.3 (Live), FC1, FC2, MDK10CE, MDK10OE, Gentoo
Posts: 51

Original Poster
Rep: Reputation: 15
I have

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

In my .bash_profile.

Does it have to be source ~/.bashrc?
As you can see, mine is just .

In addition, yes, my .bashrc contains my alias definitions.
 
Old 01-02-2004, 06:18 AM   #4
core
Member
 
Registered: May 2003
Location: Berlin
Distribution: Slackware 9.1 Kernel: 2.6.4
Posts: 60

Rep: Reputation: 15
Well.. the file .bashrc is read by non-login shells, but screen is a login shell by default.. . so man bash states about that problem...

anyway .. try
ln -s ~/.bashrc ~/.bash_login
ln -s ~/.bashrc ~/.bash_profile

and screen should read your aliases etc..
 
Old 01-02-2004, 08:01 PM   #5
VxJasonxV
Member
 
Registered: Apr 2003
Location: Mesa, AZ
Distribution: RH9, LFS5, Knoppix 3.2/3.3 (Live), FC1, FC2, MDK10CE, MDK10OE, Gentoo
Posts: 51

Original Poster
Rep: Reputation: 15
no dice.
I even ended screen and re-started it just to make sure.

I checked /etc/bashrc and there's nothing in there to override the aliases, at least... not with aliases of it's own.

Anything else I should be looking for?
 
Old 01-02-2004, 11:46 PM   #6
fr0zen
Member
 
Registered: Nov 2003
Location: 127.0.0.1
Distribution: xubuntu
Posts: 217

Rep: Reputation: 30
I've noticed some systems like to hide those defaults in /etc/profile.d

Check that directory. This is typical for RedHat/Mandrake systems.
 
Old 01-03-2004, 01:49 AM   #7
VxJasonxV
Member
 
Registered: Apr 2003
Location: Mesa, AZ
Distribution: RH9, LFS5, Knoppix 3.2/3.3 (Live), FC1, FC2, MDK10CE, MDK10OE, Gentoo
Posts: 51

Original Poster
Rep: Reputation: 15
yep. Found that out tonight browsing through other forums and threads and such.

I moved the /etc/bashrc call to the top of my .bashrc file, and then put MY aliases and such below it.
 
Old 01-13-2004, 06:24 PM   #8
VxJasonxV
Member
 
Registered: Apr 2003
Location: Mesa, AZ
Distribution: RH9, LFS5, Knoppix 3.2/3.3 (Live), FC1, FC2, MDK10CE, MDK10OE, Gentoo
Posts: 51

Original Poster
Rep: Reputation: 15
New problem, now the aliases aren't loading whenever I'm NOT in screen.
Obviously, logging in over SSH is a login shell, so why aren't my aliases being defined?

Everything else in the .bashrc is executed properly.
 
Old 02-05-2004, 04:00 AM   #9
VxJasonxV
Member
 
Registered: Apr 2003
Location: Mesa, AZ
Distribution: RH9, LFS5, Knoppix 3.2/3.3 (Live), FC1, FC2, MDK10CE, MDK10OE, Gentoo
Posts: 51

Original Poster
Rep: Reputation: 15
May I ~bump~ this? It's been 3 weeks, and I'd like to figure this out, but I don't understand why it's not alias'ing properly.

[edit]
As it turns out, there is unalias ls and unalias ll lines in my .bash_profile... and I swear to god I didn't put them in there.
Must have been my friend (root) toying with me .
Thanks everyone.

Last edited by VxJasonxV; 02-06-2004 at 07:41 PM.
 
  


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 problems: "configure, make, make install" commands don't work ditch* Linux - General 3 07-19-2005 05:37 PM
How to export stuff and add aliases in bash MalachiX Linux - Newbie 2 03-21-2005 07:33 PM
Respect !! Ben_total LinuxQuestions.org Member Intro 3 03-04-2005 06:15 PM
Bash aliases won't autostart? Ollir Mandriva 7 08-22-2004 03:10 PM
Is it me or did MS show a little respect to Linux just now? vous General 3 05-15-2003 01:24 PM


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