Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #173528 > unrolled thread

Jessie - Strange Alias Problem

Started by"S. P. Molnar" <s.molnar@sbcglobal.net>
First post2016-10-17 16:40 +0200
Last post2016-10-17 22:20 +0200
Articles 12 — 4 participants

Back to article view | Back to linux.debian.user


Contents

  Jessie - Strange Alias Problem "S. P. Molnar" <s.molnar@sbcglobal.net> - 2016-10-17 16:40 +0200
    Re: Jessie - Strange Alias Problem Greg Wooledge <wooledg@eeg.ccf.org> - 2016-10-17 16:50 +0200
    Re: Jessie - Strange Alias Problem "Thomas Schmitt" <scdbackup@gmx.net> - 2016-10-17 18:30 +0200
      RE: Jessie - Strange Alias Problem "Stephen P. Molnar" <s.molnar@sbcglobal.net> - 2016-10-17 18:50 +0200
        Re: Jessie - Strange Alias Problem "Thomas Schmitt" <scdbackup@gmx.net> - 2016-10-17 19:00 +0200
          Re: Jessie - Strange Alias Problem "S. P. Molnar" <s.molnar@sbcglobal.net> - 2016-10-17 19:00 +0200
            Re: Jessie - Strange Alias Problem Greg Wooledge <wooledg@eeg.ccf.org> - 2016-10-17 19:10 +0200
              Re: Jessie - Strange Alias Problem "Thomas Schmitt" <scdbackup@gmx.net> - 2016-10-17 19:40 +0200
                Re: Jessie - Strange Alias Problem "S. P. Molnar" <s.molnar@sbcglobal.net> - 2016-10-17 19:50 +0200
                  Re: Jessie - Strange Alias Problem "Thomas Schmitt" <scdbackup@gmx.net> - 2016-10-17 21:20 +0200
                    RE: Jessie - Strange Alias Problem "Stephen P. Molnar" <s.molnar@sbcglobal.net> - 2016-10-17 21:40 +0200
                      Re: Jessie - Strange Alias Problem "Thomas Schmitt" <scdbackup@gmx.net> - 2016-10-17 22:20 +0200

#173528 — Jessie - Strange Alias Problem

From"S. P. Molnar" <s.molnar@sbcglobal.net>
Date2016-10-17 16:40 +0200
SubjectJessie - Strange Alias Problem
Message-ID<sthf3-4Gc-1@gated-at.bofh.it>
I am running an up to date Jessie with the bash shell and have 
encountered a very strange problem.

I have the following line in my /home/comp/.bashrc;

  alias l='ls -l --color'

If I source the file in my /home/comp it works - once!, and only in my 
home directory!!!  If I change to another directory - it doesn't work!

I'm not even sure what to Google at this point.

Any pointers tot he solution to this problem will be much appreciated.

Thanks in return.

-- 
Stephen P. Molnar, Ph.D.	Life is a fuzzy set
www.Molecular-Modeling.net	Stochastic and multivariate
(614)312-7528 (c)
Skype:  smolnar1

[toc] | [next] | [standalone]


#173529

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2016-10-17 16:50 +0200
Message-ID<sthoJ-4JB-19@gated-at.bofh.it>
In reply to#173528
On Mon, Oct 17, 2016 at 10:34:11AM -0400, S. P. Molnar wrote:
> I have the following line in my /home/comp/.bashrc;
> 
>  alias l='ls -l --color'
> 
> If I source the file in my /home/comp it works - once!, and only in my 
> home directory!!!  If I change to another directory - it doesn't work!

Use the command "type l" before and after changing directory, to be
sure your alias is still set the way you expect.  It's possible that
you've overridden the "cd" command in such a way that it removes or
changes your aliases (although that would be a pretty unusual thing
to do).

[toc] | [prev] | [next] | [standalone]


#173539

From"Thomas Schmitt" <scdbackup@gmx.net>
Date2016-10-17 18:30 +0200
Message-ID<stiXv-5Qr-7@gated-at.bofh.it>
In reply to#173528
Hi,

S. P. Molnar wrote:
> I have the following line in my /home/comp/.bashrc;
>  alias l='ls -l --color'
> If I source the file in my /home/comp it works - once!, and only in my home
> directory!!!

What exactly do you mean by "[to] source" ?


> If I change to another directory - it doesn't work!

I can reproduce this only if the other directory contains nothing but
data files which do not get a fancy color.
(I put the alias into ~/.bashrc and start a new xterm to get it into
 effect.)


Have a nice day :)

Thomas

[toc] | [prev] | [next] | [standalone]


#173540

From"Stephen P. Molnar" <s.molnar@sbcglobal.net>
Date2016-10-17 18:50 +0200
Message-ID<stjgR-5Xu-19@gated-at.bofh.it>
In reply to#173539

-----Original Message-----
From: Thomas Schmitt [mailto:scdbackup@gmx.net] 
Sent: Monday, October 17, 2016 12:27 PM
To: debian-user@lists.debian.org
Subject: Re: Jessie - Strange Alias Problem

Hi,

S. P. Molnar wrote:
> I have the following line in my /home/comp/.bashrc;  alias l='ls -l 
> --color'
> If I source the file in my /home/comp it works - once!, and only in my 
> home directory!!!

What exactly do you mean by "[to] source" ?


> If I change to another directory - it doesn't work!

I can reproduce this only if the other directory contains nothing but data files which do not get a fancy color.
(I put the alias into ~/.bashrc and start a new xterm to get it into
 effect.)


Have a nice day :)

Thomas

source /home/comp/.bashrc

[toc] | [prev] | [next] | [standalone]


#173541

From"Thomas Schmitt" <scdbackup@gmx.net>
Date2016-10-17 19:00 +0200
Message-ID<stjqy-61C-45@gated-at.bofh.it>
In reply to#173540
Hi,

i wrote:
> > What exactly do you mean by "[to] source" ?

Stephen P. Molnar wrote:
> source /home/comp/.bashrc

I had already tested with
  . ~/.bashrc

Now re-tried with
  source ~/.bashrc
and the same result. I get colors if there are color-worthy files.

When it does not work for you, what do you get from this:

  alias l


Have a nice day :)

Thomas

[toc] | [prev] | [next] | [standalone]


#173542

From"S. P. Molnar" <s.molnar@sbcglobal.net>
Date2016-10-17 19:00 +0200
Message-ID<stjqy-61C-65@gated-at.bofh.it>
In reply to#173541
On 10/17/2016 12:55 PM, Thomas Schmitt wrote:
> Hi,
>
> i wrote:
>>> What exactly do you mean by "[to] source" ?
> Stephen P. Molnar wrote:
>> source /home/comp/.bashrc
> I had already tested with
>    . ~/.bashrc
>
> Now re-tried with
>    source ~/.bashrc
> and the same result. I get colors if there are color-worthy files.
>
> When it does not work for you, what do you get from this:
>
>    alias l
>
>
> Have a nice day :)
>
> Thomas
>
>
comp@AbNormal:~$ alias l
-bash: alias: l: not found

-- 
Stephen P. Molnar, Ph.D.	Life is a fuzzy set
www.Molecular-Modeling.net	Stochastic and multivariate
(614)312-7528 (c)
Skype:  smolnar1

[toc] | [prev] | [next] | [standalone]


#173543

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2016-10-17 19:10 +0200
Message-ID<stjAd-6l5-7@gated-at.bofh.it>
In reply to#173542
On Mon, Oct 17, 2016 at 12:53:41PM -0400, S. P. Molnar wrote:
> comp@AbNormal:~$ alias l
> -bash: alias: l: not found

Use "type l" immediately after sourcing the .bashrc file.  Then do it
again, then do your cd, then do it a third time.

If the .bashrc is simply malformed, then the alias ought not to work
even the first time.  But you reported that it does work once.

If the alias is set immediately after "source", but then goes away
immediately, then you're probably clobbering it in a DEBUG trap, or
in a PROMPT_COMMAND.

If the alias persists after the first type command, but goes away when
you cd, then you've probably got an alias or function overriding the
cd command.

[toc] | [prev] | [next] | [standalone]


#173545

From"Thomas Schmitt" <scdbackup@gmx.net>
Date2016-10-17 19:40 +0200
Message-ID<stk3g-6wD-53@gated-at.bofh.it>
In reply to#173543
Hi,

S. P. Molnar wrote:
> > -bash: alias: l: not found

The command which makes this reproducible for me is

  unalias l


Greg Wooledge wrote:
> [...] DEBUG trap [...] PROMPT_COMMAND [...]
> [...] alias or function overriding the cd command.

So many interesting ways to shoot the own foot.

@S. P. Molnar:
What do you get from these commands

  trap
  echo "$PROMPT_COMMAND"
  alias


Have a nice day :)

Thomas

[toc] | [prev] | [next] | [standalone]


#173546

From"S. P. Molnar" <s.molnar@sbcglobal.net>
Date2016-10-17 19:50 +0200
Message-ID<stkcW-6Af-21@gated-at.bofh.it>
In reply to#173545
On 10/17/2016 01:41 PM, Thomas Schmitt wrote:
> Hi,
>
> S. P. Molnar wrote:
>>> -bash: alias: l: not found
> The command which makes this reproducible for me is
>
>    unalias l
>
>
> Greg Wooledge wrote:
>> [...] DEBUG trap [...] PROMPT_COMMAND [...]
>> [...] alias or function overriding the cd command.
> So many interesting ways to shoot the own foot.
>
> @S. P. Molnar:
> What do you get from these commands
>
>    trap
>    echo "$PROMPT_COMMAND"
>    alias
>
>
> Have a nice day :)
>
> Thomas
>
>

comp@AbNormal:~$ l
-bash: l: command not found
comp@AbNormal:~$ trap
trap -- '' SIGTSTP
trap -- '' SIGTTIN
trap -- '' SIGTTOU
comp@AbNormal:~$ echo "$PROMPT_COMMAND"

comp@AbNormal:~$ alias
comp@AbNormal:~$ source .bashrc
comp@AbNormal:~$ trap
trap -- '' SIGTSTP
trap -- '' SIGTTIN
trap -- '' SIGTTOU
comp@AbNormal:~$ echo "$PROMPT_COMMAND"

comp@AbNormal:~$ alias
alias adt='/home/comp/Apps/MGLTools-latest/bin/adt'
alias l='ls -l --color'
alias ls='ls --color=auto'
alias mopac='/opt/mopac/MOPAC2016.exe'
comp@AbNormal:~$

-- 
Stephen P. Molnar, Ph.D.	Life is a fuzzy set
www.Molecular-Modeling.net	Stochastic and multivariate
(614)312-7528 (c)
Skype:  smolnar1

[toc] | [prev] | [next] | [standalone]


#173551

From"Thomas Schmitt" <scdbackup@gmx.net>
Date2016-10-17 21:20 +0200
Message-ID<stlC1-7KA-19@gated-at.bofh.it>
In reply to#173546
Hi,

S. P. Molnar wrote:
> comp@AbNormal:~$ trap
> ...
> comp@AbNormal:~$ echo "$PROMPT_COMMAND"

These do not look like they could be the culprit.


> comp@AbNormal:~$ alias
> alias adt='/home/comp/Apps/MGLTools-latest/bin/adt'
> alias l='ls -l --color'
> alias ls='ls --color=auto'
> alias mopac='/opt/mopac/MOPAC2016.exe'

What do you get later, when "l" is not available as alias any more ?
Do the others persist or are all gone ?


Have a nice day :)

Thomas

[toc] | [prev] | [next] | [standalone]


#173552

From"Stephen P. Molnar" <s.molnar@sbcglobal.net>
Date2016-10-17 21:40 +0200
Message-ID<stlVn-7Rn-19@gated-at.bofh.it>
In reply to#173551

-----Original Message-----
From: Thomas Schmitt [mailto:scdbackup@gmx.net] 
Sent: Monday, October 17, 2016 3:18 PM
To: debian-user@lists.debian.org
Subject: Re: Jessie - Strange Alias Problem

Hi,

S. P. Molnar wrote:
> comp@AbNormal:~$ trap
> ...
> comp@AbNormal:~$ echo "$PROMPT_COMMAND"

These do not look like they could be the culprit.


> comp@AbNormal:~$ alias
> alias adt='/home/comp/Apps/MGLTools-latest/bin/adt'
> alias l='ls -l --color'
> alias ls='ls --color=auto'
> alias mopac='/opt/mopac/MOPAC2016.exe'

What do you get later, when "l" is not available as alias any more ?
Do the others persist or are all gone ?


Have a nice day :)

Thomas

None of the alias's work.

[toc] | [prev] | [next] | [standalone]


#173555

From"Thomas Schmitt" <scdbackup@gmx.net>
Date2016-10-17 22:20 +0200
Message-ID<stmy5-8ps-7@gated-at.bofh.it>
In reply to#173552
Hi,

Stephen P. Molnar wrote:
> None of the alias's work.

That would be the effect of

  unalias -a

or of a subshell which exits before you try to execute "l" again

  $ ( alias xyz='echo xyz' ; alias xyz ) ; alias xyz
  alias xyz='echo xyz'
  bash: alias: xyz: not found


Have a nice day :)

Thomas

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web